Section 10.2. Modeling a Use Case Using an Interaction Overview


10.2. Modeling a Use Case Using an Interaction Overview

That's all the new notation for interaction diagrams; now it's time to look at a practical example. To set the stage, we are going to develop an interaction overview diagram from scratch for the Create a New Regular Blog use case reusing parts from the interaction diagrams created in the previous chapters.

The big difference between the example in this chapter and the modeling in previous chapters is that with an interaction overview, we can pick and choose from the different interaction diagram types. By using an interaction overview approach, each part of the interaction is modeled using the techniques that are most effective for that part.

10.2.1. Pulling Together the Interactions

First, we need to decide how the interaction overview will be broken down into the most effective diagrams for each of the individual interactions, as shown in Figure 10-4.

When modeling the Select Blog Account Type, Create Regular Blog Account, and Tidy Up Author Details interactions, message order is more important than any other factor. The relevant steps can be reused from the sequence diagrams modeled in Chapter 7, as shown in Figure 10-5.

For variety's sake, the Enter Author Details will be displayed as a communication diagram, as shown in Figure 10-6.

You could decide to represent the Enter Author Details interaction as a communication diagram simply because it is easier to understand, but there is so much similarity between sequence and communication diagrams that mixing the two on one interaction overview is not often seen; modelers tend to prefer one type of diagram or the other.

The Check Author Details interaction must enforce the timing constraint that its messages will all be executed within five seconds (see Chapter 9). The focus is on timing for this part of the overview and thanks to the fact that an interaction overview can contain any of the different types of interaction diagram, a timing diagram can be employed for the Check Author Details interaction, as shown in Figure 10-7.

Figure 10-3. Starting with the initial node, the control flow executes Interaction1, followed by Interactions 2 and 3 in parallel; Interaction4 will execute only if the condition is assessed as being true; otherwise, Interaction5 is executed 10 times in a loop before the control flow merges and the final node is reached


Figure 10-4. All three types of interaction diagram are used in this overviewsd indicates a sequence diagram, cd is for a communication diagram, and, not surprisingly, td stands for a timing diagram


An interaction overview diagram can offer an ideal place to use the alternative timing diagram notation, as shown in Figure 10-7. Since interaction overviews can get pretty big, the alternative notation often works best since it makes good use of the space available.


Figure 10-5. Some interactions to are best modeled using sequence diagrams to focus on message ordering


Figure 10-6. Enter Author Details in a communication diagram


Figure 10-7. Adding a timing diagram to show critical timing constraints for one interaction within the overview


Now that all the interactions have been added to the interaction overview, all of the participants involved are known so we can add their names to the diagram's title, as shown in Figure 10-8.

Figure 10-8. Adding each of the participants involved in an interaction to the lifeline list in the interaction overview's title bar


10.2.2. Gluing the Interactions Together

The final piece of the puzzle in the Create a New Regular Blog Account interaction overview is the actual flow of control between each of the separate interaction diagrams, as shown in Figure 10-9.

The control flow in Figure 10-9 shows that each of the separate interactions are executed in order. The one deviation from the normal path occurs at the Create Regular Blog Account interaction, shown as a sequence diagram, which is executed only if the author details checked out during the Check Author Details interaction.




Learning UML 2.0
Learning UML 2.0
ISBN: 0596009828
EAN: 2147483647
Year: 2007
Pages: 175

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net