UML and Other Modeling Diagrams for Design

We have studied UML diagrams for the requirements phase of the SDLC, particularly use case and sequence diagrams. In addition, we have read about other UML diagrams (like static or structure diagrams) and other concept modeling diagrams (like entity-relation diagrams). We focused on use cases and sequence ones because those provide key support in capturing requirements and transitioning to design. In design, the diagrams created in the Requirements phase are extended by adding details to those diagrams or creating other diagrams (like collaboration diagrams). It is important to recognize the concepts represented in each type of diagram and that a diagram is a language for communicating those concepts. Those concepts can be represented in different ways, involving one type of diagram, several types of diagrams, or a diagram and associated narratives. Recall the detailed textual/narrative information for contracts associated with a use case diagram; also, recall the references we've made to other or optional or additional textual information. These concepts will be elaborated by evolving their diagram representations in the design and construction phases.

Dynamic UML models

  • While static models (use cases, class diagram, component diagram) are done for the system as a whole, dynamic models are done only for key components
  • State diagram
    • Specifies behavior of a single object 
    • Diagram has states and transitions only 
  • Sequence diagram
    • Shows details of one scenario and messages that flow between objects/organizations in that scenario over time
    • Heavily used in standards
  • Activity diagram 
    • Shows flow of logic, data, messages
    • Diagram has activities, decisions, forks, joins (parallel) 
    • Replaces flow charts
  • Communication diagram
    • Shows flow of messages as a graph
    • Used as variant of sequence diagram 
  • Others, as needed
State diagram example

State diagram example

An object (account in this example) can be in only one state at any time


State diagram exercise

  • Model the state transitions of a student's registration in this class: 
    • Preregistered
    • Registered
    • Listener
    • Dropped 
    • Complete, incomplete (not resolved), etc.
  • Remember that an entity can only be in one state at any time. It cannot be in two or more states.
State diagram solution

State diagram solution


Activity diagram 

  • Shows flow of messages, logic, actions 
  • This is at a much higher level of abstraction than flow charts
    • Flow charts show logic for single method (if statements, loops, etc.) 
    • Activity diagrams show flow among objects
Activity diagram example

Activity diagram example


Activity diagram exercise 

  • Draw an activity diagram for getting an apartment. Example activities are: 
    • Find roommates
    • Find apartment
    • Sign apartment lease
    • Get electric service 
    • Get phone or cable TV service
    • Get gas or oil heat account set up 
    • Obtain furniture
    • Move in 
  • (Use this as a simple model of setting up a warehouse…)
  • Use activities, decision nodes, fork/join nodes
Activity diagram solution

Activity diagram solution


Sequence diagram (optional)

  • Objects or entities are diagrammed at the top
  • Each object's life is represented by a vertical line from creation to destruction
  • Messages or events are diagrammed from the sending object to the receiving object, in the order in which they occur
  • Responses may or may not be diagrammed, depending on complexity/obviousness 
  • These are sometimes called ‘swim lane' diagrams
    • Swim lanes can be used in activity diagrams as well
Sequence diagram example

Sequence diagram example


UML Summary

  • Use UML while writing scenarios and narratives as an initial requirements document 
    • Diagram use cases, then refine them into scenarios
    • Focus on completeness of use cases
  • Use UML component diagrams to list all system elements
    • Focus on completeness, and use to set system boundaries
  • Prepare the initial data model (next lecture)
    • Add operations/methods to the entities, after understanding the data, to create a class diagram
  • Use UML state diagrams, sequence diagrams and activity diagrams to specify objects and processes 
    • Prepare these selectively for complex or interesting objects
  • UML is becoming a 'universal' language: staff coming to a project know it, which sharply reduces learning curve
    • Developers and analysts can both understand it readily
    • Consultants/analysts use UML even for analysis-only projects (as well as writing requirements and modeling data)
    • Business process execution language (BPEL) in Web lectures is UML extension to directly create systems

Source: Massachusetts Institute of Technology, https://ocw.mit.edu/courses/1-264j-database-internet-and-systems-integration-technologies-fall-2013/resources/mit1_264jf13_lect_7/
Creative Commons License This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 License.

Last modified: Friday, December 8, 2023, 1:19 PM