Page 299 -
P. 299

266     Part 3  •  the analysis Process

                                         decisions. The use of unique symbols and swimlanes makes this diagram one that people want to
                                         use to communicate with others.
                                             Activity diagrams may be used to construct test plans. Each event must be tested to see
                                         whether the activity diagram goes to the next state. Each decision must be tested to see whether
                                         the correct path is taken when the decision conditions occur.
                                             Activity diagrams are not used for all use cases. Use an activity diagram when:
                                           1. It helps to understand the activities of a use case.
                                           2. The flow of control is complex.
                                           3. There is a need to model workflow.
                                           4. All scenarios need to be shown.

                                         An analyst would not need an activity diagram when the use case is simple or there is a need to
                                         model the change of state.
                                             Activity diagrams may also be used to model a lower-level method, showing detailed logic.
                                         Repository Entries for an Activity Diagram
                                         Each state and event may be further defined using a text description in a repository, which is
                                         a collection of text descriptions for the project. We describe states with information about the
                                         state, such as the web page name, elements on the web page, and so on. We describe events
                                         with the information that is required to communicate with the next state, such as the data from
                                         the Web form, the data that is put into a message queue, or with a description of the event that
                                         caused the transition, such as a button click.


                                         Sequence and Communication Diagrams
                                         An interaction diagram is either a sequence diagram or a communication diagram, both of which
                                         show essentially the same information. These diagrams, along with class diagrams, are used in a
                                         use case realization, which is a way to achieve or accomplish a use case.

                                         Sequence Diagrams
                                         A sequence diagram can illustrate a succession of interactions between classes or object instances
                                         over time. Sequence diagrams are often used to illustrate the processing described in use case
                                         scenarios. In practice, sequence diagrams are derived from use case analysis and are used in
                                         systems design to derive the interactions, relationships, and methods of the objects in the system.
                                         Sequence diagrams are used to show the overall pattern of the activities or interactions in a use
                                         case. Each use case scenario may create one sequence diagram, although sequence diagrams are
                                         not always created for minor scenarios.
                                             The symbols used in sequence diagrams are shown in Figure 10.10. Actors and classes or
                                         object instances are shown in boxes along the top of the diagram. The leftmost object is the start-
                                         ing object and may be a person (for which a use case actor symbol is used), window, dialog box,
                                         or other user interface. Some of the interactions are physical only, such as signing a contract. The
                                         top rectangles use indicators in the name to indicate whether the rectangle represents an object,
                                         a class, or a class and object.


                                                   objectName:         A name with a colon after it represents an object.
                                                   :class              A colon with a name after it represents a class.
                                                   objectName:class    A name, followed by a colon and another name,
                                                                       represents an object in a class.


                                         A vertical line represents the lifeline for the class or object, which corresponds to the time from
                                         when it is created through when it is destroyed. An X on the bottom of the lifeline represents
                                         when the object is destroyed. A lateral bar or vertical rectangle on the lifeline shows the focus of
                                         control when the object is busy doing things.
                                             Horizontal arrows show messages or signals that are sent between the classes. Messages
                                         belong to the receiving class. There are some variations in the message arrows. Solid arrowheads
   294   295   296   297   298   299   300   301   302   303   304