The
essence of object orientation is that objects collaborate
to achieve a goal.
Trygve Reenskaug mailto:
try...@ifi.uio.no
Morgedalsvn. 5A http://folk.uio.no/trygver/
N-0378 Oslo http://fullOO.info
Norway Tel: (+47) 22 49 57 27
With this definition of "Interaction", it sounds like there would always be a one-to-one correspondence between System Operations and Interactions. A System Operation is triggered and the appropriate Interaction is executed in response. Is that correct?
If that's the case, then there won't always be only one
Interaction per scenario. Think of booking a flight or train
ticket - in one scenario there are multiple user actions / system
operations and thus multiple interactions. But there still might
be (and I would argue should be) an overarching Context for the
whole use case, e.g. BookFlight (which can delegate to nested
contexts as needed).
--
You received this message because you are subscribed to the Google Groups "object-composition" group.
To unsubscribe from this group and stop receiving emails from it, send an email to object-composit...@googlegroups.com.
To post to this group, send email to object-co...@googlegroups.com.
Visit this group at https://groups.google.com/group/object-composition.
For more options, visit https://groups.google.com/d/optout.
With this definition of "Interaction", it sounds like there would always be a one-to-one correspondence between System Operations and Interactions. A System Operation is triggered and the appropriate Interaction is executed in response. Is that correct?
If that's the case, then there won't always be only one Interaction per scenario. Think of booking a flight or train ticket - in one scenario there are multiple user actions / system operations and thus multiple interactions. But there still might be (and I would argue should be) an overarching Context for the whole use case, e.g. BookFlight (which can delegate to nested contexts as needed).
Den 13. aug. 2017 kl. 15.49 skrev Trygve Reenskaug <try...@ifi.uio.no>:I'm no use case expert -- far from it. I now learn that there is a further breakdown of system behavior below the scenario. My point was to remind you of the second dimension in DCI that gives a capability of coding one context --> many behaviors (Interactions). (An Interaction can call another Interaction in the same Context)
I've never seen a proof that there MUST be one-to-one correspondence between use cases and Contexts. Cope?
To unsubscribe from this group and stop receiving emails from it, send an email to object-composition+unsub...@googlegroups.com.
Indeed we might have multiple contexts that has same number of roles.And it is tempted to merge them into one context, and support multiple related habit(s)/use case(s) in the same context since they have same number of roles and they might even share some edge(s)....So it is convenient sometimes.
My best solution for now (inspired by Cope's pong game's example):
- If we look at the use case definition, it has a trigger (one and only one), so the trigger must come from outside of the context.In this case it might be a controller that handles an event then create the context and trigger its system operation method to start the context.
- After that everything else must happen within the context including multiple user actions (or trigger events)We can do this by consider the controller as a role in the context, and explicit connect multiple user actions into one of the roles to handle them.
--
You received this message because you are subscribed to the Google Groups "object-composition" group.
To unsubscribe from this group and stop receiving emails from it, send an email to object-composit...@googlegroups.com.
To post to this group, send email to object-co...@googlegroups.com.
Visit this group at https://groups.google.com/group/object-composition.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to object-composition+unsub...@googlegroups.com.
To post to this group, send email to object-co...@googlegroups.com.
Visit this group at https://groups.google.com/group/object-composition.
For more options, visit https://groups.google.com/d/optout.
--
The essence of object orientation is that objects collaborate to achieve a goal.
Trygve Reenskaug mailto: try...@ifi.uio.no
Morgedalsvn. 5A http://folk.uio.no/trygver/
N-0378 Oslo http://fullOO.info
Norway Tel: (+47) 22 49 57 27
I don't like either code example. I don't think there should ever be a public method called AssignRoles. Code outside a Context should only pass in whatever data it needs (via the constructor and/or a trigger method, as appropriate) without being concerned about how the roles will be bound. Role-binding is an internal concern of the Context and a programmer should be able to change the way roles are bound at any time without affecting any code outside the Context.
Also, it looks like it would be possible to call AssignRoles()
more than once during the same use case execution, which makes the
Context even more leaky / unsafe.
To unsubscribe from this group and stop receiving emails from it, send an email to object-composit...@googlegroups.com.
In DCI, separation of concerns means that the code is clearly separated into Data, Context, Interaction partitions.
--True. I use the Interaction keyword to isolate the context object from the role scripts. The compiler enforces this bifurcation of the Context so that the programmer can't 'smart' and cross the barrier in his/her head or code. The AssignRoles method is invisible in the CONTROLLER role script so the indirect access is required: CONTEXT.AssignRoles().
--
You received this message because you are subscribed to the Google Groups "object-composition" group.
To unsubscribe from this group and stop receiving emails from it, send an email to object-composition+unsub...@googlegroups.com.
To post to this group, send email to object-composition@googlegroups.com.
Den 22. aug. 2017 kl. 00.17 skrev Matthew Browne <mbro...@gmail.com>:What if MODEL is a use case context like PlaceOrder in the shopping cart example? With trigger methods like these:processProductSelection(desiredProductId: Int)getOrderDetails()processProductRemoval(productId: Int)processPayment()
Den 22. aug. 2017 kl. 00.17 skrev Matthew Browne <mbro...@gmail.com>:What if MODEL is a use case context like PlaceOrder in the shopping cart example? With trigger methods like these:processProductSelection(desiredProductId: Int)getOrderDetails()processProductRemoval(productId: Int)processPayment()Who calls these?
Whether this entity contains the UI code is, to me, a separate question from whether these steps form part of the same flow. I do not see why it follows. Further, I do not understand why it is important. Too much such separation leads to a client / server architecture and is likely to force business intelligence into the GUI.
On Tuesday, August 22, 2017 at 4:17:00 AM UTC-4, Cope wrote:
Den 22. aug. 2017 kl. 00.17 skrev Matthew Browne <mbro...@gmail.com>:
What if MODEL is a use case context like PlaceOrder in the shopping cart example? With trigger methods like these:
processProductSelection(desiredProductId: Int)getOrderDetails()processProductRemoval(productId: Int)processPayment()
Who calls these?
I guess that's the question...I was thinking they would be called by the MVC Controller. Alternatively, if all of this were internal to the PlaceOrder Context, then I'm sure it would be organized differently.
Whether this entity contains the UI code is, to me, a separate question from whether these steps form part of the same flow. I do not see why it follows. Further, I do not understand why it is important. Too much such separation leads to a client / server architecture and is likely to force business intelligence into the GUI.
Let's take a step back...suppose you want to buy something on an online store, say Amazon.com. I would say two of the major use cases from the customer's perspective are "Browse Products" and "Place Order". Place Order would include choosing shipping options and paying for the order. The division between the two is where it perhaps gets a bit more subjective...I would say that as soon as you add a product to your shopping cart, you've started the Place Order use case. It's a little tricky because after adding one product to your cart, you might want to go browse more products and add more items to your cart. Even after reading Alistair Cockburn's book (Writing Effective Use Cases) this still seems like a bit of a gray area to me. I guess one could argue that the user's real goal is to purchase something, so Browse Products wouldn't be a (user goal-level) use case on its own...but what about "window shopping"? If we're talking about a super-simple store (nothing like Amazon.com), then a separate use case for Browse Products would probably be unnecessary. With the Place Order use case that Marc wrote, I can imagine a very simple UI in which the whole product inventory could perhaps be made available via just a couple drop-down menus. (I'm assuming that "Don's Auto Shop" doesn't have a huge inventory.)
In any case, I was thinking of Place Order as a guided step-by-step process including adding items to a shopping cart and checking out.
--
You received this message because you are subscribed to the Google Groups "object-composition" group.
To unsubscribe from this group and stop receiving emails from it, send an email to object-composit...@googlegroups.com.
To post to this group, send email to object-co...@googlegroups.com.
Visit this group at https://groups.google.com/group/object-composition.
For more options, visit https://groups.google.com/d/optout.
Den 22. aug. 2017 kl. 23.35 skrev Matthew Browne <mbro...@gmail.com>:I guess that's the question...I was thinking they would be called by the MVC Controller.
Den 23. aug. 2017 kl. 08.12 skrev Trygve Reenskaug <try...@ifi.uio.no>:
Googled online shopping. Found "Design and Implementation of E-Commerce Site
for Online Shopping" by Sidhartha Reddy Vatrapu; Governors State University.
<eibnmomgccmimobe.gif>
I see View - Context(s) - Data - Database
Hi Trygve,
What if MODEL is a use case context like PlaceOrder in the shopping cart example? With trigger methods like these:processProductSelection(desiredProductId: Int)
getOrderDetails()
processProductRemoval(productId: Int)processPayment()
Den 23. aug. 2017 kl. 10.17 skrev Andreas Söderlund <cisc...@gmail.com>:Lots of "process", that worries me...! Can the "process" methods be called in any order? What kind of process is that?
Hi Trygve,
What if MODEL is a use case context like PlaceOrder in the shopping cart example? With trigger methods like these:
processProductSelection(desiredProductId: Int)getOrderDetails()processProductRemoval(productId: Int)processPayment()
(Side-note: I probably wouldn't call the role 'Model' in this case, but rather the name of the Context, so 'PlaceOrder').
The debate here is whether or not this is a good design...on the one hand, people are arguing that there shouldn't be multiple public entry-points to the Context, e.g. there would only be one public method like 'startOrder()' and all UI interaction from that point until the end of the use case would be handled within the PlaceOrder context. This requires mixing UI concerns into the use case context.
And on the other hand, I am arguing that multiple public trigger methods as above are a fine design as long as you do the appropriate validation to ensure that the methods aren't called in the wrong order. And it has the benefit of keeping the UI code decoupled from the use case.
We might need to go through this example from the very beginning in detail in order to get to the bottom of it, but since you weren't an active participant in the original discussion we had about it (last year I think), I figured I'd start with this quick summary.
To unsubscribe from this group and stop receiving emails from it, send an email to object-composit...@googlegroups.com.
To post to this group, send email to object-co...@googlegroups.com.
Visit this group at https://groups.google.com/group/object-composition.
For more options, visit https://groups.google.com/d/optout.
Hi Trygve,
Thank you for continuing to clarify your big planning example
(Prokon). It's certainly a very helpful example. Unfortunately it
doesn't answer the question I'm asking here, because all the use
cases in that example can be achieved with a single interaction
between the user and the system. For example, the user requests to
frontload the activities, and the system does it, and that's the
end of the use case.
As to the online shopping example, I'm thinking it might be better to start with the use case of placing an order on Amazon.com rather than a fictional auto parts shop. It's a concrete example and we already have a shared understanding of how it works.
But since you asked about the use case for the existing example,
first of all I'll reiterate that the use case is at the top
of the code, in the comments. A while ago I started working
on my own version of the use
case description, which is very similar but uses a
two-column format that you might find a bit easier to
follow...(but I didn't write the deviations for it yet [which are
in the original], so it currently only shows the main success
scenario).
processProductRemoval(productId: Int)processPayment()
Lots of "process", that worries me...!
This seems to hark back to an old myth that user input comes in through the Controller. For most of these I would envision it coming in through the View.
Also, in my later MVC implementations, a view accepts and handles user input relevant to itself. The Controller accepts and handles input relevant to the Controller/View assembly as a wholeBased on that and Trygve's responses to my MVC questions on this list, I interpret this to mean that for cases where something more needs to happen in response to a user input event than just calling a Context method (perhaps some other UI-related code needs to run before/after), then it would make sense to write a method in the Controller to respond to the event.
I don't see MVC as a straight jacket, but as an inspiration. I let it guide my implementations, but not constrain me when other solutions are clearly more readable.
Hi Trygve,
Thank you for continuing to clarify your big planning example (Prokon). It's certainly a very helpful example. Unfortunately it doesn't answer the question I'm asking here, because all the use cases in that example can be achieved with a single interaction between the user and the system. For example, the user requests to frontload the activities, and the system does it, and that's the end of the use case.
Sorry, Trygve, I misremembered how the interface for the planning app works. I have studied the organization of the code and run the application in the past, but I'm on a Mac and didn't have easy access to it...I didn't mean to make you explain the interface and send a screenshot, although of course it's good to be clear on it for this discussion.
Thanks,
Matt
--
You received this message because you are subscribed to the Google Groups "object-composition" group.
My question to our use case specialists: Is 'Planning' one use case? The whole is triggered by the user giving one command. If many: What are they and where is the user's perception of the whole?
The user goal is the goal of greatest interest. It is the goal the primary actor has in trying to get work done or the one the user has in using the system. It corresponds to "elementary business process" in business process engineering.
A user goal addresses the question "Can the primary actor go away happy after having done this?" For a clerk, it is "Does your job performance depend on how many of these you do today?," or the coffee break test: "After I get done with this, I can take a coffee break." In most circumstances, it passes the one person, one sitting test (2-20 minutes).
Neither "Complete an online auction purchase" nor "Log on" generally count as a user goal. Online auctions take several days and so fail the single-sitting test. Logging on 42 times in a row does not (usually) satisfy the person’s job responsibilities or purpose in using the system.
"Register a new customer" and "Buy a book" are likely to be user goals. Registering 42 new customers has some significance to a sales agent. A book purchase can be completed in a single sitting.
A tool, such as a hammer, is not a use case. Editing the plan is not a use case. Editing the plan for a given purpose can be a use case. My planning interface is not a use case. In engineering, a CTR (Cost Time & Resource) describes an activity. A user goal use case could be to enter a CTR into the system. My tool could be modified to fit this job. The use case sub-function level could be supported by commands and implemented as Contexts. I have long suspected that there may be a many-to-many relationship between use cases and Contexts. (A tool, e.g., a(hammer, can be used for many goals, and a job a goal can need many tools). Excuse the clumsy language, I hope you see what I mean.It would be interesting to see the shopping example in this light. (Not shopping cart, the cart is not a goal). We're getting there, I think.
Den 24. aug. 2017 kl. 09.52 skrev Trygve Reenskaug <try...@ifi.uio.no>:My question to our use case specialists: Is 'Planning' one use case? The whole is triggered by the user giving one command. If many: What are they and where is the user's perception of the whole?
Here is a user narrative for Amazon.com, which I figure is a useful starting point since we're probably all familiar with it. I thought the idea of shopping being separate from payment was interesting, so I incorporated that.
~~~
Sam is a software developer and an Amazon customer who recently
installed the Amazon app on his phone. He wants to buy two books:
Working With Objects: The Ooram Software Engineering Method
by Trygve Reenskaug, and Lean Architecture: for Agile Software
Development by James Coplien. He is at his home computer, so
he logs in to Amazon.com and adds the books to his shopping cart,
but then he realizes that it's time to leave for work, so he
decides to to complete the order on the train on his phone. Once
on the train, he opens the (native) Amazon app on his phone and
logs in, and taps the shopping cart icon in the top menu. He
suddenly remembers about another book he wanted to buy, Perfect
Software: And Other Illusions about Testing by Gerald
Weinberg. So he adds that to his shopping cart as well and finally
proceeds to checkout. For his payment method, he selects a credit
card that was already saved in his Amazon account. He completes
the order and Amazon emails him a receipt.
So I suppose the next step would be to start drafting the use
cases. I'm thinking that especially given the nature of shopping
on Amazon, there should be two use cases for selecting and buying
products - "Select Products to Purchase" and "Place Order". Select
Products to Purchase would include adding and/or removing products
to the shopping cart, and Place Order would comprise the whole
checkout process.
Den 26. aug. 2017 kl. 02.17 skrev Matthew Browne <mbro...@gmail.com>:So I suppose the next step would be to start drafting the use cases.
Thanks Cope. If I were building a new online store from scratch, then I should indeed do all of those things. But my only goal here is to establish enough context to discuss a realistic online shopping use case on this group. I chose Amazon.com because we already share at least a basic understanding of how it works and why people use it. Do you think it's necessary to do all of the analysis you suggested just to discuss the example here? If so then I'll need to pick a simpler example, because duplicating all the real analysis and design that went into building even the first version of Amazon would be a big job, and probably impractical for discussion on this group. I know there are details of Amazon's business that none of us know, so there will probably be gaps and mistakes in any use cases I write, but most of our other DCI examples aren't 100% realistic either and we're still able to discuss the merits of various implementations.
--
You received this message because you are subscribed to the Google Groups "object-composition" group.
Den 26. aug. 2017 kl. 13.33 skrev Matthew Browne <mbro...@gmail.com>:Do you think it's necessary to do all of the analysis you suggested just to discuss the example here?
Regarding the business rules, should those be listed in some
separate document in advance of the use case writing?
Den 26. aug. 2017 kl. 13.58 skrev Matthew Browne <mbro...@gmail.com>:Regarding the business rules, should those be listed in some separate document in advance of the use case writing?
Den 26. aug. 2017 kl. 14.05 skrev Matthew Browne <mbro...@gmail.com>:
. . . I was thinking that the process of writing use cases . . .
Den 26. aug. 2017 kl. 15.34 skrev Matthew Browne <mbro...@gmail.com>:Good point. And of course the writing is a group activity too.
Den 27. aug. 2017 kl. 07.29 skrev Matthew Browne <mbro...@gmail.com>:Haha, that's obviously not what I meant. Anyway.