Section 8.2. Fleshing out an Interaction with a Communication Diagram


8.2. Fleshing out an Interaction with a Communication Diagram

With the new communication diagram notation out of the way, it's now time to look at a practical example. We're going to take one of the sequence diagrams from Chapter 7 and show how its interactions can also be modeled on a communication diagram (see Figure 8-9).

Figure 8-9. This sequence diagram describes the interactions that take place in a CMS when a new regular blog account is created


Don't be afraid to refer back to Chapter 7 to help you out with the notation shown on the sequence diagram. Sequence diagrams contain a lot of unique notation, and mastering it all can take some time! It isn't necessary to have a sequence diagram before you create a communication diagram. You can create communication diagrams or sequence diagrams for your interactions in whatever order you see fit.

The first step is to add the participants from Figure 8-9 to the communication diagram shown in Figure 8-10.

Figure 8-10. The participants involved in an interaction are often the first pieces added to a communication diagram


Next, the links between each of the participants are added so they can communicate with each other, as shown in Figure 8-11.

It's now time to add the messages that are sent between participants during the lifetime of the interaction, as shown on Figure 8-12. When adding messages to a communication diagram, it's usually best to start with the participant or event that kicks off the interaction.

Figure 8-11. By looking at the sequence diagram in Figure 8-9, the links required to support the message passing can be added to the communication diagram


Figure 8-12. The Administrator actor starts things off by passing three separate messages to the ui:AccountCreationUserInterface participant


Once the initial message or messages are added to the communication diagram, things start to get more complicated. The 3. enterAuthorDetails( ) message triggers a nested creation message that is sent from the ui : AccountCreationUserInterface participant to create a new authorDetails : CustomerDetails participant. Nested messages get an additional decimal point based on the triggering message's number, as shown in Figure 8-13.

Figure 8-13. When the <<create>> message is added to the communication diagram, its message order number is set to 3.1. to show that it is nested inside the 3. enterAuthorDetails( ) message


With that small hurdle out of the way, the rest of the messages can be added to the communication diagram (see Figure 8-14).

Figure 8-14. The finished communication diagram shows the complete set of messages within the Create a new Regular Blog Account interaction according to those shown on the original sequence diagram shown in Figure 8-9





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