These are chat archives for jdubray/sam

6th
Nov 2016
Chui Tey
@teyc_twitter
Nov 06 2016 00:03
Hi I came across the original article at infoQ, and I'm intrigued and confused about learn or state. Let's say I'm at the checkout page of an ecommerce store. If I've already provided my credit card number in the past, I can proceed to buy immediately. Otherwise, I will need to provide my credit card number. In this case, my valid actions depend on state right?
since my model is class Customer { CreditCard StoredCreditCard {get; set; }}
Jean-Jacques Dubray
@jdubray
Nov 06 2016 01:58
@teyc_twitter there is two ways you can look at your question:
a) only allow actions that are "allowed"
b) accept/reject a proposal
Here you would think the view would not display the "one click purchase" button (hence the action is not allowed). If you want to control which actions are allowed you can use the SAFE library that will not even trigger an action that's not allowed, but it's just an authorization mechanism, it's best to render the UI with the one-click-purchase action disabled.
You could have a "purchase" button and this time, based on the creditCardStored flag would decide how the model updates (accept the purchase proposal: proceed to display the payment information form or in nap() initiate the payment action). The result of the payment action could then be presented to the model (success, failure,...).
Chui Tey
@teyc_twitter
Nov 06 2016 02:11
Hi JJ, where does learn fit into all these? Does SAM prescribe which component is responsible for coordination once a payment action is completed? My reading of SAM tells me there is a component that listens or learns that the model has been updated, yes?
Jean-Jacques Dubray
@jdubray
Nov 06 2016 02:13
yes, there are two aspects to "learn":
a) render the application state
b) compute the next-action-predicate which decides if there are any "automatic actions"
Both of them can happen once the application state mutation has completed
Chui Tey
@teyc_twitter
Nov 06 2016 02:38
thanks. On a side note, I noticed that you've had a long history of doing model based development. I've a long standing interest in it, but I keep coming to the sad conclusion that not many people can execute it well - including myself, hence the bulk of development happens without it. What's your view?
Chui Tey
@teyc_twitter
Nov 06 2016 02:50
by the way, I like the bolt framework. I see it being useful in my work.
Jean-Jacques Dubray
@jdubray
Nov 06 2016 03:11
ah MDE... I was first introduced to MDE with Interface Builder back in 1990. It was great at the time, I continued using MDE for BPM / B2B. I started to step away from MDE back in 2005-2006 when I started to realize that there was something that did not seem to fit in OMG's MDA. I started to talk about Metamodel Oriented Programming
In other words that MDE was way too "anemic" to have a chance to work. I tried several times to create some illustration of what MOP would look like with Canappi (a mobile development tool) and most recently with Chorus.js, then I landed on SAM/JavaScript, first as an alternative to orchestration language and then as a full Application Architecture. These days, I don't look back, I feel the combination of SAM and JavaScript is just right.
I still use a bit of MDE for problems that are simply impossible solve programmatically such as that one.
Jean-Jacques Dubray
@jdubray
Nov 06 2016 03:17
Happy you like BOLT, I must admit that's quite a mystery to me that it never took off. One day maybe!
Charles Rector
@chuckrector
Nov 06 2016 04:27
where can i learn more about BOLT? it is difficult to find some information. the site is defunct (http://www.b-mc2.com/) and i could only find a short slideshow (http://www.slideshare.net/jdubray/bolt-introduction) and a sort of "teaser" article (http://www.ebpml.org/blog2/index.php/2012/11/03/bolt-a-business-strategy-methodology)
Charles Rector
@chuckrector
Nov 06 2016 04:38
ah, i have found the book https://www.amazon.com/mc2-Business-Strategy-Multidimensional-World/dp/1481181300 bummer it has no digital format
Jean-Jacques Dubray
@jdubray
Nov 06 2016 08:18
Charles Rector
@chuckrector
Nov 06 2016 08:18
thinking of "state" in SAM like a "mode" as in "mode of operation" seems to make it easier on my mind. if i'm shifting gears in a car, and i am in P, i am in "parking mode". if i am in R, i am in "reverse mode". so... the current mode will be determined somehow by the values of the model. slightly more illustrative might be lighting an LED -- it has two terminals and you must connect the right types of power to each one. only once those conditions have been met by that "model" will the mode be set to "emit light". but the mode itself is not responsible for manufacturing that light, but rather only determining that conditions are ripe for doing so. so once the mode recognizes those preconditions, the appropriate view will be informed (will "learn") that is must display itself in a "lit format" -- for example, an isLit: true property will be computed and passed to that view
@jdubray thank you!
Jean-Jacques Dubray
@jdubray
Nov 06 2016 08:19
If you have an iPad you can download the book for free: https://itunes.apple.com/us/book/b-mc2/id584185735?mt=11
Charles Rector
@chuckrector
Nov 06 2016 08:21
looks like i can download it just fine in macos sierra and read it too -- woohoo!
Jean-Jacques Dubray
@jdubray
Nov 06 2016 08:23
yes, works from iBooks
I have a PDF version also if any is interested
Charles Rector
@chuckrector
Nov 06 2016 08:24
that would be great, as it is a more familiar format
Jean-Jacques Dubray
@jdubray
Nov 06 2016 08:24
but the iBooks version is better UX
Charles Rector
@chuckrector
Nov 06 2016 08:25
really, weird. PDF is prized for presentation i thought
on that note, perhaps Apple is even more prized for presentation ^_^
Jean-Jacques Dubray
@jdubray
Nov 06 2016 08:26
yes, at least one thing they did not screw up yet
Charles Rector
@chuckrector
Nov 06 2016 08:26
heh!
Jean-Jacques Dubray
@jdubray
Nov 06 2016 08:28
wrt to State, yet, I think it's really important to realize that the property values and mode of operation/status/state. You could even have different state functions for the same model.
the exact same model.
Charles Rector
@chuckrector
Nov 06 2016 08:31
hmm, i think i understand. so while you could have multiple views of a given model, you can also have multiple "mode generators" which interpret the model's values in different ways
i remember seeing a graph of pollution level thresholds in China versus other parts of the world
so China's "mode generator" given a pollution level of "100" might compute a view of "A-OK". but USA's mode generator for the same pollution level would compute a view of "TOXIC"
Jean-Jacques Dubray
@jdubray
Nov 06 2016 14:43
yes, that's a way to think of it. It works also, say, for different kinds of players in a game.
Charles Rector
@chuckrector
Nov 06 2016 18:29
Ah, much more succinct! Players necessarily experience different subsets of the same model