Source
Useful diagrams from UML
A selection of diagrams that are really useful in design.
UML is a unified modeling language that grew out of the three notations of Gradi Booch, James Rumbaugh and Ivar Jacobson. It remains a convenient way to discuss architecture, solution design, and system behavior. This chapter focuses on diagrams and their usefulness, not just books and standards. If you want a quick intro to the role of notations, take a look at the software architecture overview chapter. And if you are interested in the evolution of architecture and the view of one of the co-authors of UML, take a look episode with Gradi Butch.
Why UML is useful in System Design
Common language of architecture
UML helps to discuss the system without ambiguity between engineers and business.
Focus on solutions
Diagrams capture trade-offs, dependencies, and key architectural choices.
Explaining the complex
One sheet with a diagram often replaces dozens of pages of text.
Basis for evolution
Models help plan changes without losing the context of the system.
Main UML diagrams and their purpose
Movie
Evolution of software architecture
An episode with Gradi Booch about UML, abstraction and the role of the architect.
UML no longer dominates the market - C4 Model or other modeling methods are often chosen. But these diagrams still help you quickly break down a system, discuss scenarios, and see trade-offs.
Use Case
Scenarios, roles and goals. The point is in the text happy path and exceptional flow, and not in the little people.
Parking System
UML Modeling Levels (M0-M3)
UML describes models at different levels of abstraction. This helps not to mix real objects, models and rules for their construction.
M0
Real World / Instances
Specific objects and their connections in a real system. Object diagram - a snapshot of the state.
M1
Models
Custom UML models: use case, class, sequence and other diagrams.
M2
Metamodel
UML specification: concepts of Class, Association, Attribute and rules for their use.
M3
Meta-metamodel (MOF)
MOF describes metamodels and can be applied to more than just UML.
Detailed analysis of levels - in the post Modeling levels in UML and why there are only 4 of them.
Why are there only four levels?
Self-Description MOF
M3 describes itself, so no additional level is needed.
No infinite recursion
If you enter M4, you will need M5, M6, and so on.
Practical sufficiency
M0-M3 cover all modeling tasks in engineering practice.
MOF - Meta-Object Facility: link to description.
Examples of levels in different areas
Example from HR
- M0 - employee Ivan Petrov, born 03/15/1990
- M1 - class "Employee" with fields name, date of birth
- M2 - concepts of "Class", "Attribute", "Relationship" in UML
- M3 - meta class and meta attribute as a template for M2
Example from construction
- M0 - furniture and people in rooms
- M1 - room plans with object locations
- M2 - building architecture and structure
- M3 - building codes and design rules
An example from linguistics
- M0 - sentence "Ivan is reading a book"
- M1 - Russian language rules and parts of speech
- M2 - terms "phoneme", "morpheme" and others
- M3 - philosophy of language and meta-level of description
How to put UML into practice
- Don't draw everything - choose a diagram based on the purpose of the conversation.
- Start simple: use case or sequence, then go deeper.
- Keep models relevant and use them in discussions.
- Combine UML with C4 and ArchiMate when you need to show context.
