These are chat archives for jdubray/sam

1st
Mar 2018
Victor Noël
@victornoel
Mar 01 2018 08:08
it has nothing to do with it :)
Jean-Jacques Dubray
@jdubray
Mar 01 2018 15:51
@paulreimer they are very different in nature, SAM would sit above CQRS (not implying any kind of hierarchy), for instance on the front-end calling a CQRS back-end. Actions call Queries while the model calls Commands. So SAM is compatible with CQRS.
There are also some similarities since CQRS maintains some kind of "state representation" to serve queries (read model), separate from "the" model.
I am more concerned with the Event Sourcing aspects of CQRS, Event Sourcing does not pass the "temporal logic" test (or any kind of time travel approach). Event Sourcing only works as long as you do not change the underlying state machine.
Otherwise you'd start (re)playing events into incompatible states, that makes absolutely no sense. Thinking that you can arbitrarily replay events is a myth.
Jean-Jacques Dubray
@jdubray
Mar 01 2018 15:59
image.png
Based on my Application Stack Architecture, CQRS would fit right were you would expect at the Microservices layer (a microservice is an integration point into a system of record)
The integration point sounds a bit less sexy than microservice, but it has the merit of positioning clearly the microservices layer otherwise it becomes too fuzy to reason about.
Application architecture needs to balance two incompatible aspects: Activity and Consistency and, way too often, people don't realize that these concerns need to be clearly delineated in the back-end.
Jean-Jacques Dubray
@jdubray
Mar 01 2018 16:06
That's why technologies like GraphQL emerged, they manage the activity aspects, but no technology deals with consistency at this point.
devin ivy
@devinivy
Mar 01 2018 16:13
graphql and consistency is rough
Jean-Jacques Dubray
@jdubray
Mar 01 2018 16:14
:-)
Paolo Furini
@pfurini
Mar 01 2018 16:18
another google framework.. new record, a single company pushing 3 different frameworks, somewhat competing and overlapping. What will be the next? :P
Jean-Jacques Dubray
@jdubray
Mar 01 2018 16:26
and then I see that...
class CounterState extends State<Counter> {
  int counter = 0;

  void increment() {
    // Tells the Flutter framework that state has changed,
    // so the framework can run build() and update the display.
    setState(() {
      counter++;
    });
  }

  Widget build(BuildContext context) {
    // This method is rerun every time setState is called.
    // The Flutter framework has been optimized to make rerunning
    // build methods fast, so that you can just rebuild anything that
    // needs updating rather than having to individually change
    // instances of widgets.
    return new Row(
      children: <Widget>[
        new RaisedButton(
          onPressed: increment,
          child: new Text('Increment'),
        ),
        new Text('Count: $counter'),
      ],
    );
  }
}
(facepalm)
Fred Daoud
@foxdonut
Mar 01 2018 16:46
yikes
devin ivy
@devinivy
Mar 01 2018 16:58
hopefully it's just a contrived example to show the features of flutter
i'll admit, i am confused by CounterState having a build() method that returns a view.
and also a method that performs a mutation. but react components have this too, for example, and you don't have to use them in this way. the only difference is really that you would name it CounterComponent (focused on the view) rather than CounterState (focused on the state).
Paolo Furini
@pfurini
Mar 01 2018 17:35

@devinivy

hopefully it's just a contrived example to show the features of flutter

I hope so.. and I'd add that I'm pretty tired of frameworks pushing languages on top of javascript, too. So, dear Google, you already tried to push Dart, you failed (how many shops out there using Dart in production, over ES6 or TS??) and now you're trying to sell me ANOTHER framework stack based entirely on Dart? Oh my...

Paolo Furini
@pfurini
Mar 01 2018 17:57
flutter/flutter#11093
As outlined in the linked issue, state management is an afterthought, sadly like as in many other frameworks/stacks out there
Jean-Jacques Dubray
@jdubray
Mar 01 2018 18:02
:-)
I just corrected a defect in one of my projects directly related to the lack of separation between mutation/model and state representation. :-)
Fred Daoud
@foxdonut
Mar 01 2018 18:23
@jdubray nice, any details that you can share? sounds like a good learning experience.
Jean-Jacques Dubray
@jdubray
Mar 01 2018 19:59
nothing fancy, a client needed a string with "dashed" removed from the value, while the system of record still retains dash. Since this was a key as well to query more data, depending on the order you query, mutate and create the state representation, things will get out of hand pretty quickly. On the other hand the projects where I apply SAM have rarely these kinds of defects.
Jean-Jacques Dubray
@jdubray
Mar 01 2018 21:24
devin ivy
@devinivy
Mar 01 2018 21:40
what do you make of it?
Jean-Jacques Dubray
@jdubray
Mar 01 2018 21:44
It's nice, again, they focus on what facebook needs, if that's what you need all the power to you and to them. My take on it is that they will deviate more and more from the rest of the industry and create a closed environment (still open source) sealed from the main branch. I am no expert, I only say that because for instance they are not willing to adopt Web Components. I expect they will only pick what they want and create optimizations that suits them.