These are chat archives for jdubray/sam

23rd
Jun 2017
Marcus Feitoza
@mfeitoza
Jun 23 2017 03:29
Incredible? Is insane and Google Spanner too.
Antanas A.
@antanas-arvasevicius
Jun 23 2017 11:43
Jean-Jacques Dubray
@jdubray
Jun 23 2017 13:15

I would not call it "nice", but It has always been about the application programming model:

  • (Industrial Process Control in the Semi-Conductor industry)
  • Business Process Engine,
  • B2B/~API Gateway,
  • MDSE,
  • SCA/SDO,
  • SOA,
  • API Gateway,
  • Mobile Apps
    ... and finally SAM

At least from my perspective I found what I was looking for
The key for me was this big project at Sapient that nearly failed, and of course all the similar projects (size and scope) that had the same fate, ... took me 20 years, but I found a way :-)

Jean-Jacques Dubray
@jdubray
Jun 23 2017 13:22
I now have built two big projects with SAM (big enough) to see that the technical debt does not build up. The code remains maintainable over time, there is no reason for it to build up.
Antanas A.
@antanas-arvasevicius
Jun 23 2017 13:27
I'd try to explore more about TLA+ and SAM, from first outlook I can't understand how to compose bigger applications on it.
But I remember it was the same with FP concepts, looked impossible to do anything useful without assignments/mutations
Antanas A.
@antanas-arvasevicius
Jun 23 2017 13:34
I'm concerned on composability and extensibility of SAM models, and what if action is more wider than a single model which affects multiple models
Jean-Jacques Dubray
@jdubray
Jun 23 2017 13:35
The key I found in SAM is that there is literally very little interference between different parts of the code. I don't believe you get the same with Elm or Redux because there is no obvious separation between Action/Model/State, they just put a big function box on top. Of course you could have the discipline to keep these concepts decoupled.
You should not be concerned at all, precisely an action can present to multiple models!!! or an action can present twice (a sync proposal and an async after an API call).
This is my blue print, nothing less, nothing more: https://github.com/jdubray/startbootstrap-clean-blog
The component model works well
Antanas A.
@antanas-arvasevicius
Jun 23 2017 13:37
but there is model.accept(), so if this action is more global, how could I execute it
Jean-Jacques Dubray
@jdubray
Jun 23 2017 13:37
? you can even have to methods to that accept proposals
Fred Daoud
@foxdonut
Jun 23 2017 13:37
I found it very hard with the Elm Architecture to keep things cleanly separated, i.e. for one part not to need to import from another part and be tangled together.
But I still wasn't satisfied, a lot of boilerplate is involved.
Antanas A.
@antanas-arvasevicius
Jun 23 2017 13:38
I'd do some prototypes with some complex scenarios
Marcus Feitoza
@mfeitoza
Jun 23 2017 13:38
I'm at beginning of my journey and there a lot to learn and improve my foundation because most of Universities here is so poor and basic... SAM is great starting point than OOP, the concept of proposal and acceptor is awesome. Working with CRUD is really simple and clear than using OOP approach.
Antanas A.
@antanas-arvasevicius
Jun 23 2017 13:40
but if model1 fails to present data?
or validations is only on .accept()
?
Jean-Jacques Dubray
@jdubray
Jun 23 2017 13:40
? you mean accept? this is a reactive loop, the action does not wait on any reply from the model
Marcus Feitoza
@mfeitoza
Jun 23 2017 13:41
@antanas-arvasevicius
I created a Intent resolve dispatcher
intent('model' || ['model1', 'model2', ...], 'actionName', payload)
Antanas A.
@antanas-arvasevicius
Jun 23 2017 13:42
so I cannot report back about some errors from inside model?
Jean-Jacques Dubray
@jdubray
Jun 23 2017 13:42
Sorry pressed the wrong button
Antanas A.
@antanas-arvasevicius
Jun 23 2017 13:42
validations and logic should be in action
Radosavljevic Slobodan
@radosavljevic
Jun 23 2017 13:42
@jdubray this is awesome. SAM is great by any means, but it takes quite a bit of time to understand it. A couple of months have passed how I use it/think about it, and I can say there definitely value behind it.
Marcus Feitoza
@mfeitoza
Jun 23 2017 13:42
Just for illustration I had an assignment to create a piece of shit program, we need to fallow this requirements with OOP and Java:
1- Modeling a Lunch class with one abstract class and one concrete
2- Modeling a ingredients class with TWO abstract class and one concrete
3- some methods to calculates price and bla, bla bla
I just did not! I had no idea from where I need to pick two abstract classes for ingredients.
The answer are:
abstract class Lunch
  concrete class Pizza
  concrete class Burger
abstract class Ingredientes
  abstract class Cheese
     concrete class Mozzarella
     concrete class Cheedar
   abstract class AnotherIngredient
      concrete class AnotherIngredientType
Jean-Jacques Dubray
@jdubray
Jun 23 2017 13:43
Here was the action:
actions: [

        { 
            name: "myActionWithTwoModels",
            implementation: function(data, present, model) {

                    model1.present(data) ;
                    model2.present(data) ;

                    return false ;
            }
        }
    ]
@radosavljevic thank you!
@radosavljevic can I quote you?
Antanas A.
@antanas-arvasevicius
Jun 23 2017 13:44
@jdubray so the "model" is like React component here? like ViewModel in MVVM?
Jean-Jacques Dubray
@jdubray
Jun 23 2017 13:44
not quite I think.
Antanas A.
@antanas-arvasevicius
Jun 23 2017 13:45
but it doesn't return and "signal" anythere else?
Jean-Jacques Dubray
@jdubray
Jun 23 2017 13:45
MVVM is certainly close to SAM because they use a "model" separate from the view-model (which would fit at the State level)
Radosavljevic Slobodan
@radosavljevic
Jun 23 2017 13:45
@jdubray sure. I think it will be a long journey with SAM, I just started. :)
Antanas A.
@antanas-arvasevicius
Jun 23 2017 13:46
but in MVVM I can add some core validations inside a "model", e.g. throw exception if some given value is not according to rules
Jean-Jacques Dubray
@jdubray
Jun 23 2017 13:46
The problem with MVVM is on the action side, they use two-way data binding.
@radosavljevic :+1:
Antanas A.
@antanas-arvasevicius
Jun 23 2017 13:48
Where I'd get lost is where is my business/service layer on SAM pattern, is it exists as on regular OO architectures
Radosavljevic Slobodan
@radosavljevic
Jun 23 2017 13:48
just for the record, techical debt for an app written with SAM isn't building up that's for sure, however I write a lot of if clauses :)
Antanas A.
@antanas-arvasevicius
Jun 23 2017 13:48
persistence | business objects | service layer | view layer
or I can wrap regular business objects into SAM "model" and SAM "action" delegate to service layer methods
I'm just trying to mind-map similiarities within known concept
Jean-Jacques Dubray
@jdubray
Jun 23 2017 13:50
SAM changes the application architecture quite a bit (if you want to)
http://www.ebpml.org/blog15/2016/08/services-apis-and-microservices-part-2/
I don't feel you need to think along these terms anymore. Traditional Application Architecture is a 6 layer deal, SAM collapses it to 4.

however I write a lot of if clauses :)

me too...

Antanas A.
@antanas-arvasevicius
Jun 23 2017 13:52
Oh, thanks, from these diagrams It made a little more clear
Jean-Jacques Dubray
@jdubray
Jun 23 2017 13:52
but I still like it better than a traditional function/api call
now we need to convince ES8 to create a syntactic shortcut for it!
@antanas-arvasevicius SAM solves the problem of needing a one-to-one relationship between View and back-end API
Radosavljevic Slobodan
@radosavljevic
Jun 23 2017 13:54
hehe, that would be awesome. Didn't math started to make sense when we switched from roman numbers to arabic :)
Jean-Jacques Dubray
@jdubray
Jun 23 2017 13:54
That's really the paradigm shift
yes!
Antanas A.
@antanas-arvasevicius
Jun 23 2017 13:56
Understood, thanks!
So SAM is a way of thinking about how to wire backend service API's to frontend GUI interface
Jean-Jacques Dubray
@jdubray
Jun 23 2017 13:56
@foxdonut your articles look very interesting, I wish I had some time to explore it. I'll try to take a look over the week-end
@antanas-arvasevicius that's where I started, the entire problem come from there, other architectures don't give you a choice.
I saw this $1B CRM project collapse under the "vertical slice architecture"
Antanas A.
@antanas-arvasevicius
Jun 23 2017 13:58
it was MVC based?
Jean-Jacques Dubray
@jdubray
Jun 23 2017 13:58
yes of course! .Net
Antanas A.
@antanas-arvasevicius
Jun 23 2017 13:58
:)
Marcus Feitoza
@mfeitoza
Jun 23 2017 13:59
And about instead of using ifs and maybe use object mapping proposal key -> function?
if (proposal.todo !== undefined) {}
// do
const maps = {
  todo: () => {}
}
if (keyOfProposal in maps) {maps[key](proposal, model)
Jean-Jacques Dubray
@jdubray
Jun 23 2017 13:59
The whole idea is that the size of project forces you little by little to duplicate your code across "vertical slices" because you cannot reuse existing "slices".
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:00
But with SAM you also will duplicate
oh, but only on frontend
not on backend
?
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:00
@mfeitoza I hate it, the key of the model structure is to have a many-to-many relationship with actions
SAM decouples completely the view from the back-end API, there is no reason whatsoever not to reuse an API
even after you needed to change it
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:01
right
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:02
The whole pattern Action+Model+State gives you ample ways to never have to couple an API to the View
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:03
We have a project which is kind of CRUD based application, where is a listgrid and some dialog with dynamic form and a concept called DataSource which is tightly bound to backend API (fecth / add / update / remove)
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:03
Actions can call the API and mashup a proposal, the Model can look at the proposal and fill out property values as it pleases, the State function can then slice all these model properties in view props.
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:03
and have Actions, which is RpcCommands bound with backend RpcCommand realisation
we have problems on updating GUI state after action completes
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:04
what kind of problem?
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:04
e.g. action "Make invoice Void" and it affects more entities / models in backend
so we need to properly update it on frontend, or just invalidate models in frontend (do refetch)
problems like that
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:06
SAM should make it easier to deal with. It's really perfect for orchestration.
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:06
So I'm thinking about a structure how to keep everything consistent. We need somehow to send back all entities changes to the frontend after action completes
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:07
Yes, consistency is my obsession (Business Process, B2B, SOA...). There is the first library I wrote for SAM, just to deal with that: https://bitbucket.org/jdubray/star-javascript
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:07
to send a command/action to backend is simple, but to get back all state changes information is hard when that action hits multiple service layer APIs
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:08
This is a simple illustration about using that library in an orchestration capability: http://www.ebpml.org/blog15/2015/06/designing-a-reliable-api-call-component-with-sam/
yes, I hear you. This should really help you. Then when you have it you can create a proposal to the model.
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:09
Thank you for information, I'll read it all
But there is a need to design also a backend properly
to have that consistent functionallity?
Because how to track what have had changed the specific service?
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:10
yes, but you can only achieve consistency (the eventual kind) through orchestration
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:10
But I think ORM layer is not a good friend here? :D
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:10
Don't list to all the Event-Driven crap, you'd end up modeling req/resp + orchestration with events (not fun)
Forget ORM, doesn't work.
Who is a afraid of writing SQL queries?
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:11
My idea was to collect all changes before ORM flush/commit and send back everything to frontend, and frontend could handle what to change
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:11
That's the other side of STAR (R is for relationship).
Forget that
You'd be wasting your time
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:11
Easy to say.. :)
150k+ lines already there
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:12
Frameworks are like poison
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:12
It's an LOB application with rich domain model/objects
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:12
They won't kill you at small doses, then you are dead
Yes, I love those.
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:13
so It was easy to do ER modeling, then creating some Entity, and binding entity to some generic EntityDataSource
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:13
yeap
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:13
which exploses CRUD API to frontend
Marcus Feitoza
@mfeitoza
Jun 23 2017 14:13
@jdubray I think I was not clear, the model will continue to have many-to-many with actions.
Lets clarify:
model.present = (data) => {
        if (data.toggleAll) {}
    if (data.editItemId !== undefined) {}
    if (data.selectItemId !== undefined) {}
    if (data.deletedItemId !== undefined) {}
}
////// do
const maps = {
  toggleAll: (data) => {},
  editItemId: (data) => {},
  selectItemId: (data) => {},
  deletedItemId: (data) => {},
}
model.present = (data) => {
    // just suppose if is passed one proposal
    const key = Object.keys(data)[0]
    if (maps.hasOwnProperty(key)) {
        maps[key](data)
  }
}
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:14
so everything is nice and fast, until hit complex "actions" , or some "post save" "post update" which propagates changes on multiple entities
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:14
@mfeitoza I don't know, I find it suspicious.
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:14
and GUI just stalls with old data
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:15
@mfeitoza the conditions can be more complex than that.
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:15
and we just doing hardcoded GUI controls invalidations after each action completes, just not elegant
I'd afraid that with SAM we end up in much boilerplate to simulate all that CRUD like binding
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:15
If you have specific questions, you can email me if you want, happy to look at it.
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:16
or there is approach to somehow use SAM and old style together
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:16
I use template literals, I don't feel that there is any boilerplate on the view
au contraire, it gives me a lot of freedom to create the view as it should be
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:17
@jdubray so using SAM everything should be modeled as actions? not as CRUD like style, e.g. Action "update entity"?
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:17
the data binding is part of the problem
@antanas-arvasevicius As I have explained in the discussions on REST, "CRUD" is a myth.
Marcus Feitoza
@mfeitoza
Jun 23 2017 14:18
@jdubray of course could have more complex scenarios, but in this case the scenarios is simple and flat.
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:18
It's hard to go over the arguments again (don't have time this morning), but a resource has action. Reifying "State" behind CRUD properties is the problem not the solution.
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:18
But customers used to CRUD applications then want than all inputs would be editable
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:18
Sure, some resources are pure CRUD (say like a customer profile)
but an Invoice is not a "CRUDable" resource
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:19
But sometimes they want that it look like CRUDable
:))
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:19
no, I think the developer wants it to look like CRUDable
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:20
maybe, but customers also wants to open invoice and edit its values (like in customer profile)
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:21

That's what I was saying in the conclusion of my latest post:

when you think of it, there is a common thread between GoF, Business Processes, B2B, Architecture, Enterprise Architecture, SOA and even REST: we are missing a type of building block, which is otherwise rather intuitive to humans: State.

I don't dispute it, but when the invoice has been "paid" it makes no sense to do so
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:22
yes, but it depends on invoice status
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:22
See the problem is when your programming model is flawed, you start writing code that makes no sense to compensate.
Yes, exactly, the question is "status" a property? or is it part of your programming model?
With SAM invoice status is not a property, it's part of your programming model
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:23
but it's stored inside Invoice(model) property
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:23
Well, ... it does not matter how it is serialized, what matters is the business logic that hangs off of it
This is where you need to change perspective.
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:24
what do you mean with "programming model"? You mean is it expressed in a programming language explicitly? e.g. enum structure InvoiceStatus object
?
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:25
It can't be expressed in the programming language, so it can only be a pattern for now.
But when you "pay" an invoice you don't CRUD it
that's an action
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:25
sure
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:26
well the problem is that with traditional MVC based approaches that's not part of the programming model
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:27
so if we have a model lets say Invoice, it have a set of actions, but from that set only some subset of actions can be executed on that model
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:27
Again, I didn't wake up one day and said, here is SAM/STAR, please use it.
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:27
some kind of state machine
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:27
You have to look back and think about all the concepts that you are using when building such system, sort out what is important and what is not
and how they fit together
Yes, exactly it is a state machine
but the problem is that classical state machine don't work
that's where I go stuck for a very long time
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:28
it's more like workflow
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:28
no
it's a state machine
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:28
what is on top of classical?
state is outside
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:29
Classical state machines are a directed graph of states, the edges are actions
image.png
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:30
yes
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:30
For instance I can create a state machine that computes the solution to the die hard problem
I can even create a programming language from that state machine
image.png
Once I have a state machine in mind I can list the actions and compose them freely, that that "freedom" is an illusion
That's the problem with all programming languages and pretty much all "action-based" paradigms (patterns, frameworks,...)
They give you the certainly that you can compose actions (lines of code) without ever thinking to the underlying state machine
The problem is that if you think in terms of classical state machines you'll enter a black hole
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:32
You mean they skip state graphs?
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:33
yes, when you write code, no one thinks about the underlying state machine
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:33
but you say that thinking in classical state machine is either not good
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:33
Classical state machine don't work, don't go there, I spent 10-15 years there.
Enters TLA+
image.png
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:34
I've bookmarked an url from video you gave for TLA+ spec
oh :D
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:34
In TLA+ the actions never decide of the end-state
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:35
so it specifies what transitions can be from state A to state B and what preconditions
but do not do transitions automatically?
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:35
The action creates a proposal to mutate the application state (model), but the resulting state (whether the invoice was paid or not as a result of the payInvoice action) is computed after the mutation
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:35
there is some kind of "resolver"?
so new component is "proposal"?
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:36
In SAM, the State function computes the state representation
the new idea is the two greyish arrows
request = proposal
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:37
a.k.a. computes future state which will be proposed to a model?
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:37
The graph of state/actions is observed not a programming model
yes, the action computes the model properties as they should be accepted, but it does not know if they will, it could depend on a lot of other factors
The action should not know anything about that
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:38
but where persistence goes? or some side effects e.g. submit email to customer
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:39
That's why OOP, FP, Petri nets, RP, ... have all be tried, they all somehow make sense, but none of them are complete
that is irrelevant, it is part of the programming model
SAM does not make any restriction on it, as long as you keep the semantics of the pattern in place.
Actions can call APIs, I prefer to do queries in the actions and create/update/delete in the model
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:40
but State function I think should not do anything because it doesn't know whether model accepts that new state or not
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:40
but that's just a preference.
the state function is called by the model as part of the reactive loop
that's another key aspect of the pattern, no one can look at the model
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:41
should model can get out of sync?
e.g. not accepting something, and it gets completely out of sync
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:41
once the mutation has occurred, the model triggers the state function which creates a state representation (a snapshot)
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:41
or State function looks at the model's state too?
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:41
No, you can never get out of sync
Your wiring has to make sure that's not the case, the state function should be synchronous which in Javascript is not a problem since it is single threaded.
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:43
Ok, @jdubray, thank you for your explanation, I think I need to do my homework on that for further discussion.
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:44
yes, I understand how it can be confusing
I spent 20 years wrestling with that question, so answers might look obvious to me
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:44
5 years ago I'd remember Scala first steps.. :D
from 10 years on OOP only
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:45
:+1:
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:46
It was really weird moment, when you get understanding that there was a nice paradigm next to OO
and you haven't seen it so long time
I think you know feel somehow the same, but opposite, you see SAM/TLA+ as future, but no one sees that
:D
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:48
yes, it feels a bit weird, it's true. It escapes me sometimes. Even my closest friends stare in the horizon. That's why it was important for me to work on big(ger) projects, I don't like to just speak in the vacuum of code samples.
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:49
: )
I don't know how much efforts needed to train a team on a project
on that unfamiliar architecture
One note, you said that "state machine" is just an conceptual similarity of that TLA+/SAM not in the programming model?
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:54
It's actually not hard, you just have to write a few code samples, then it becomes very natural. The hardest is to convince people that it is not hard.
So my position is that you should avoid trying to think too much in terms of classical state machines. SAM allows you to use if-then-else in lieu of a graph of states.
However, SAM/TLA+ have a robust state machine structure embedded in it (at the programming level), so that you don't have to think about it.
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:55
just use classical control flow instead of "state transitions"?
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:56
Careful, when you use semantics like control flow, ... the idea is that you cannot change SAM's programming model. It's not advised to do so
As I mentioned, SAM is not "my pattern" or "my thinking" it's really a precise structure of concepts I uncovered (mostly from TLA+)
That precise structure should not be tampered with
Each time I tampered myself with it, I regretted it
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:57
I'll first need to familiarize with TLA+ / SAM for a while, do some demo, learn a concepts, get more deeper understanding
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:57
You really have to think about the reactive loop that goes from an event to the display of a view
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:57
and to wait a bit to settle down this info on my brains
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:57
You don't need to know too much about TLA+
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:58
I'd like to know
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:58
yes, it's fascinating
but most people don't need to go at that level
You can use SAM just by thinking that you have an event coming up and then you have 3 buckets to write your event handler
Antanas A.
@antanas-arvasevicius
Jun 23 2017 14:59
so it's node.js
:D
Jean-Jacques Dubray
@jdubray
Jun 23 2017 14:59
before you render the view in a functional-HTML way (or even data binding)
well, it works well with nodejs
I would not be surprised if people have somehow intuitively build something similar
The rules to distribute your code in the three buckets are very clear
You don't need to think much
Antanas A.
@antanas-arvasevicius
Jun 23 2017 15:00
:)
Jean-Jacques Dubray
@jdubray
Jun 23 2017 15:00
You don't need a framework
Antanas A.
@antanas-arvasevicius
Jun 23 2017 15:01
Ok, I need to go now, was a nice to talk to you. Bye and thanks again for insightful talk.
Jean-Jacques Dubray
@jdubray
Jun 23 2017 15:05
me too, thank you!
Jean-Jacques Dubray
@jdubray
Jun 23 2017 17:16
Speaking of which, this article just came up on InfoQ: https://www.infoq.com/articles/microservice-event-choreographies
Good luck with event choreographies and using classical "state machines"
Marcus Feitoza
@mfeitoza
Jun 23 2017 17:55

@jdubray I think SAM could be a Organization in Github and let everything spread across repo's:

  • sam-specification
  • sam-examples
  • x
  • y
  • z

x, y and z are frameworks that implements SAM managed by their creators.
What do you think?

Jean-Jacques Dubray
@jdubray
Jun 23 2017 18:24
Sure, I'd be very happy, not sure how to get started
Jean-Jacques Dubray
@jdubray
Jun 23 2017 19:24
Marcus Feitoza
@mfeitoza
Jun 23 2017 21:11
Fine, this weekend I will make some samples too.
I think que samples Repo should be organized by libraries:
  • React
    • todo
  • Vue
  • Angular
  • Vanilla
    soo on...
Jean-Jacques Dubray
@jdubray
Jun 23 2017 21:33
Soons, I will prepare that, thank you
Marcus Feitoza
@mfeitoza
Jun 23 2017 21:35
Cool, I can help with you want.
Let's make SAM rocks.
Jean-Jacques Dubray
@jdubray
Jun 23 2017 22:29
Absolutely!