UML Diagrams
Overview
What are UML diagrams
- Unified Modeling Language
- It’s a rich language to model software solutions, application structures, system behavior and business processes.
Types of UML diagrams
- There are two main categories of UML Diagrams
- Structural
- Class diagram
- Component diagram
- Deployment diagram
- Object diagram
- Package diagram
- Profile diagram
- Composite structure diagram
- Behaviorial
- Use case diagram
- Activity diagram
- State machine diagram
- Sequence diagram
- Communication diagram
- Interaction Overview diagram
- Timing diagram
- Structural
Good resources
- UML Diagram Types Guide: Learn About All Types of UML Diagrams with Examples
- UML cheat sheet
- UML cheat sheet UTSA
Arrows, Symbols explained
Visibility / Access Modifers
Static
Relationships
- The arrows define relationships between the different components
- Different types of Relationships
Dependency
- An object of one class might use an object of another class in the code of a method. If the object is not stored in any field, then this is modeled as a dependency relationship. For example, the Person class might have a hasRead method with a Book parameter that returns true if the person has read the book (perhaps by checking some database).
Inheritence
Generalization
- A class extends another class. For example, the Book class might extend the Document class, which also might include the Email class. The Book and Email classes inherit the fields and methods of the Document class (possibly modifying the methods), but might add additional fields and methods.
- Generally used for a base class or a subclass that extends a base class or abstract class
Realization
- A class implements an interface. For example, the Owner interface might specify methods for acquiring property and disposing of property. The Person and Corporation classes need to implement these methods, possibly in very different ways.
- Generally used when a class implements an interface
Association
One-way association
Aggregation
- Where there can be multiple of something
- Where the part can exist without the whole
- a tortoise can exists by itself or it could be in a creep, which is just a group of toroises
- the child object can exist without the parent object
- the diamond is at the end where it contains all the parts
- ex. The creep contains the tortoises
Composition
- The child object cannot exists without the parent object
- in the example the visitor center has a lobby, and also has a bathroom
- if the visitor center was to be closed for construction so would the lobby and bathroom. So the lobby and bathroom cannot exist without the visitor center
Multiplicity
- refers to the concept of denoting a number on a specific side in a uml relationship
- ex. there is 1.. to many bathrooms that can be at the visitor center
- ex. but there is only 1 lobby
Diagrams
Structural Diagrams
Class diagram
- Class diagrams are the main building block of any object-oriented solution. It shows the classes in a system, attributes, and operations of each class and the relationship between each class.
Component diagram
Behavioral Diagrams
This post is licensed under CC BY 4.0 by the author.