Sequence Diagrams in UML

Basic Approach

The previous lab on Class Diagrams in UML asked you to analyze your software engineering project to identify likely classes. Then, for each class, you identified attributes and operations, and you clarified how those elements related to each other using one or more class diagrams. The next step in object-oriented design is to examine how the classes interact in performing the user tasks needed by the application.

Work in this lab proceeds in two basic steps:

  1. Develop a complete list of operations (from the user's perspective).

  2. For each user operation, develop a sequence diagram that shows processing from the initial user interaction, through various method calls, to obtain the required result.

For simplicity, this lab asks you to write these elements out on paper, rather than entering the information into a software development tool. A later lab may ask you to incorporate this work into ArgoUML .

Use Cases

Traditionally in UML, the identification of user operations involves the development of use cases. The idea is to consider how a user will interact with the software (e.g., through a Web browser). Each type of interaction is a use case. Further, if the same initial interaction might yield several possibilities (a user is successful in logging in, or a user is unsuccessful), then each possibility is considered a separate use case.

  1. Review your project for software engineering, and develop a complete list of use cases.

    1. Organize the use cases with a text editor, and label the cases "A", "B", "C", ... .
    2. Write a sentence or two to identify each use case.
    3. If your project involves several users (e.g., students and administrators, buyers and sellers), organize the use cases by user.
    4. Review Summerville Chapter 5 to clarify the role of use cases
  2. For each use case, write an outline of the processing that should take place from the user through various classes in order to obtain the desired result.

    Again, use Summerville, Chapter 5,as a model for outlining the flow of each use case.

    Remember that if a use case requires two or more alternative outcomes or flows, then it should be divided into several separate use cases.

Note that while ArgoUML supports the development of use cases, Fowler recommends using the numbered-list approach as being more time efficient. For this part of the lab, you are allowed to use ArgoUML if you wish, but development of use cases within a text editor is considered adequate for this lab.

Sequence Diagrams

With the identification of all needed use cases, the next step is to add detail to how processing will proceed in each situation. This largely is the role of sequence diagrams (Read Sommervile, Chapter 5, for additional details.)

  1. Write out (on paper) a sequence diagram for each use case identified in steps 1 and 2.

    1. Each sequence diagram should show the logical flow of information (messages, parameters, return values) from class to class.
    2. When invoking a message, you should check (manually) that the corresponding method has been defined in your class diagram(s), with the needed parameter types, return type, etc.
    3. At this point, it is not necessary to write out the details for each method, but you should consider whether a method will likely have access to adequate information to perform the required processing.

Work to be Turned In

Each of the following should be submitted in paper form. Steps 1 and 2 should be prepared using a text editor or word processor.

  • Listing of use cases from step 1
  • Outline of processing from step 2
  • Sequence diagrams from step 3

-- JimSkon - 2012-02-16

Topic revision: r1 - 2012-02-16 - JimSkon
 
This site is powered by the TWiki collaboration platformCopyright &© by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback