CSC 223 Grinnell College Fall, 2006
 
Software Design
 

Sequence Diagrams in UML

This laboratory exercise draws upon sequence diagrams in UML to help support projects in CSC 223.

Basic Approach

The previous lab on Class Diagrams in UML asked you to analyze your CSC 223 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 CSC 223, 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. Read Fowler, Chapter 9, 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 Fowler, Chapter 9 (near page 101 ),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 Fowler, Chapter 4, 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.


This document is available on the World Wide Web as

http://www.walker.cs.grinnell.edu/courses/223.fa05/labs/uml-2.shtml

created 25 September 2005
last revised 25 September 2005
Valid HTML 4.01! Valid CSS!
For more information, please contact Henry M. Walker at walker@cs.grinnell.edu.