UML — [Notes]
3 min readDec 9, 2022
· UML
∘ Type
· Behavioral UML Diagram
∘ Use case Diagram
· Structural UML Diagram
∘ Class diagrams
∘ Component diagrams
· Use case Diagram
∘ Key components
∘ Steps to create a use case diagram
· Class diagrams
· Schema Design
∘ How to approach schema design
UML
Unified Modeling Language
Type
- Behavioral UML Diagram
- Structural UML Diagram
Behavioral UML Diagram
Use case Diagram
- What are going to be different feature in my system
- Who will use those feature
Structural UML Diagram
Class diagrams
- fields and methods in class
Component diagrams
- what are different component of software system and how do they interact
Use case Diagram
Key components
- Actor — Someone who is going to be a client of the software systems
- Use cases (diff features of the system)
- System Boundary — Contains everything that is a responsibility of the system
- Includes
- Extends — extension
Steps to create a use case diagram
- Create system boundary
- Identify the actors of the system
- Start identifying the feature that have to be exposed
- Represent who is going to use what feature
Class diagrams
- represent blue print of whole software systems
→ classes
→ interfaces
→ abstract classes
→ relationship between classes - Access modifier representation: + = public, — = private , * = protected
- Relationships:
→ IS-A/Inheritance — [Implementation of interface, Inheritance] — simple arrow
→ HAS-A/Association — [Composition, Aggregation] — arrow with diamond head - Aggregation (to collect)— object of child(City) can exist event without an associated parent(Human). [Human → City]
- Composition (I have created/composed them) — cannot exist.
[House → Room]
Schema Design
- Persistence → Database [SQL | NoSQL (Schema less)]
- Assume SQL DB
How to approach schema design
- Find out all the entities in the system
- For every entity create a table.
- Cardinality — 1:1, 1:m, m:1, m:m
- Whenever we have a relationship of 1:m or m:1, they can be represented in schema design by having the id of the 1 side (Batch) in the table of the m (Student) side.
- For m:m relationship, always have a separate mapping table
→ for this kind of mapping table, we will have to handle constraint on application side. - Keep DB as light a possible [ keep constraints on app side, eases when we want to change DB]
- For every relationship we might have attribute with respect to relationship
→ put info in mapping table itself