UML Class Diagram

Design the application structure, how the classes are related, and the following:

  • Class names
  • Attributes and methods
  • Visibility: public (+), private (-), protected (#)
  • Inheritance relationships - "is-a" relation (Dog --------▷ Animal )
  • Association relationships - "uses / has a reference to" relation (Product -------> ProductCategory)
  • Aggregation relationships - weak "has a" relation (Car ◇------ Engine)
  • Composition relationships - strong "has a" relation (House ◆------ Room)
UML Class Arrows Example

ERD Diagram

Shows the structure of the database and has the following:

  • Entities (tables)
  • Attributes (columns)
    • PK: primary key
    • FK: foreign key
    • UNIQUE: unique constraint
    • NOT NULL: not null constraint
  • Relationships between entities
    • One-to-One (1:1)
    • One-to-Many (1:N)
    • Many-to-Many (N:M)
ERD Arrows Example

RAG and Wait-Graph

RAG (Resource Allocation Graph): Shows resource allocation to help identify deadlocks in multithread systems:

  • Arrows indicate either the processor requesting the resource (P → R), or resource allocated to a processor (R → P)
RAG with deadlock
RAG Diagram with a deadlock. P2, P3, P4 can not finish their tasks.

RAG without deadlock
RAG Diagram without deadlock. P3 can finish its task and free R1 so P1 can finish and the system cascade to the rest of the processors.

RAG to Wait-Graph

To convert a RAG diagram to a wait-graph by removing all resource nodes and collapsing the appropriate arrows/edges. If a cycle can be formed with any set of processors, then there is a deadlock

RAG to wait-graph
RAG diagram (left). Wait-graph (right). There are cycles in the wait-graph so deadlocks exist.