8.2. Fleshing out an Interaction with a Communication DiagramWith 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 createdDon'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 diagramNext, 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 diagramFigure 8-12. The Administrator actor starts things off by passing three separate messages to the ui:AccountCreationUserInterface participantOnce 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( ) messageWith 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 |