These are chat archives for jdubray/sam

Mar 2016
Mar 12 2016 14:35
Hi! Nice ideas here. i was looking for transition
From a current project and i've found this
Angular.js and React make me feel pain, for discontinuation of a project.And this aproach
does not
Have you seen seneca.js in compliance with this aproach?
Mar 12 2016 14:40
Pattern match makes so much sense for "A"ction
Jean-Jacques Dubray
Mar 12 2016 14:50

In general Microservices Frameworks aligned well with SAM because SAM enforces a single state tree (Model). The Model can then decide the best course of action (so to speak) to persist itself via Microservices.

SAM also allows you to write isomorphic code trivially, so you can debug your code in the browser (Actions, Model, State) and then move it to Node when you are ready, just by changing a couple of lines of code on the client.

Here is an example with Node.js

The problem with React is that they built it for Facebook and completely missed the point that you need somehow to weave API calls into your front-end architecture. So they ended up kicking the can and created GraphQL+Relay. I would stay away from React altogether, unless you have the same problem as Facebook you are trying to push as many CPU cycle on the client (when you have 1.5B users you never want to waste to many CPU cycles on the server)

Now, I would not necessarily call seneca a Microservices Framework. It's more an invocation Framework and yet as such it would work well for Actions.
That being said, you also have to consider that the View is expressed as a function of the model so you no longer have the same problem as before where you would need to (hard) code your views.
V = f(M) works like a mini code generator in which you can wire the view component to your actions
If you want to see an example, I published yesterday the "TODO(MVC)" example
Jean-Jacques Dubray
Mar 12 2016 14:56
You'll see something call the "Theme" (the components of the View) and you'll notice that I pass a simple "intents" structure from which the component wire its instance to the actions.

I would say, there is no need for pattern matching with SAM.

The problem is that once you take the wrong turn with factoring, you enter a maze that you can never get out.

Stardrive ENGG
Mar 12 2016 20:55
@jdubray "@brucou is funny, "A model M which is hashmap with a set of properties". The hashmap with properties is the brilliant part but I'm not so sure about the extent that Cycle_HSM goes to. Seems like an incredible amount of processing required just to handle a few declarative properties. Might even be more difficult to comprehend than Cycle itself :smile: