OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

ws-caf message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: demo app and by-reference/by-value


Title: Message

I had an exchange with Simeon (mostly) on the implementors list a couple of weeks back about whether the demo app could be expanded to by-reference, so as to cover more of the spec. However, as I touched on then, I don't think the demo app *can* switch freely between by-value and by-reference, because of the way the information is being used. My suspicion is that this is typical - applications are either naturally by-value or naturally by-reference, and ones that can switch are either very rare or non-existent.

The demo app uses the context as the holder for a shopping-cart of information, with items coming from multiple stores, and then the cart-contents are checked-out by submitting the context on a different message to one of the stores.

However, the store-to-customer contract (i.e. the business protocol between them) is distinctly different depending on by-value or by-reference - mostly as a question of who "owns" the context.

If done by value, the customer owns the context. She (to distinguish) can presumably create a context from any context service she chooses, and get the stores to add things into it. In the absence of any special rules, she can take things out of it too, without any interaction with the store that added the item. The stores do not need keep any information about what is in the cart.. At check-out time, the store receiving the context will go through the items in the context, perhaps confirming with each supplying store that it is now selling the item to the customer, perhaps just charging the customer and sorting out the inventory issues later. (the model here is something like taking a real shopping cart round the departments of IKEA - you can pick up what you like, dump things out or even abandon the whole trolley, and eventually submit the trolley to the checkout, where they charge you for the items. It's IKEAs problem to put everything back where it belongs when people abandon things)

If done by reference, the context is "owned" by the stores. The context has to be created by a store. The customer doesn't have any control of the content, other than to add things to it by choosing an item at a store (removing an item would need a new operation in the store interface, or the creation of a new shopping cart interface). The stores can rely on the cart content being controlled, so their addition of an item to the cart  can be tentative, waiting for a message from check-out that the order has been taken up (or that the context has timed out). (The model would be going round a department store asking for things to be added to your list)

You can make one look more like the other, but they aren't really the same app.

Peter

 
------------------------------------------
Peter Furniss
Chief Scientist, Choreology Ltd
web: http://www.choreology.com
email: peter.furniss@choreology.com
phone: +44 870 739 0066
mobile: +44 7951 536168
 


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]