System Design

Posted on May 20, 2022

UML

UML diagrams model aspects of our system.

  • Structural diagrams illustrate objects, attributes, and operations.
    • Profile, Class, Composite structure, Component, Deployment, Object and Package diagrams.
  • Behavioural diagrams illustrate dynamic system behaviour.
    • Activity, Use case, State machine, Sequence, Communication, Interaction overview and Timing diagrams.

Context Model

Points to systems our system interacts with.

Context model UML Diagram

Structural Diagrams

Class Diagram

Static structure of system objects.

Class UML Diagram

SymbolMeaning
+Public
-Private
#Protected
/Derived
_Static
~Package (for methods)

Correct class diagrams

  • Abstract classes’ names should be in italics
  • Interface names should be prefixed with <<interface>>
  • Do not include getters, setters or inherited methods.
  • Do include interface methods

Heirarchy: Draw arrow from child to parent class.

Pointing toStyle
ClassBlack arrowhead
Abstract ClassWhite Arrowhead
InterfaceWhite arrowhead, dotted line

Association between classes.

AssociationExample
Aggregation (part of)
Composition (made up of)
Dependency (used temporarily)
  • In aggregation, one may exist without the other
  • For composition, this is not true; stronger association

Additionally, write 1 or * on associations to represent 1 to many etc. relations.

Behavioural Diagrams

Activity Diagram

Represents workflows of stepwise activities, like a flowchart.

Activity UML Diagram

State machine Diagram

System state transitions, like a finite state machine.

State machine UML Diagram

There is a correspondance between activity & state machine diagrams. Actions in state machine corerspond to boxes in activity.

Use-case Diagram

Interactions of actors with events.

Use-case UML Diagram

Sequence Diagram

Communications between objects.

Sequence UML Diagram

  • A box represents an active object (i.e. running code)
  • Nested boxes indicate recursion
  • To make notes on a sequence diagram, draw a lil’ sticky note

Object naming schemes:

Object typeNaming schemeExample
Named objectName:ClassSmith:Patient
Anonymous object:Class:Patient
Object of unknown classNameSmith

All topics ⟶