PermalinkWhat is UML Diagram?
UML is an acronym for "Unified Modeling Language".
UML is one of the most popular business process modelling techniques to document and model software.
UML is used as a general-purpose modelling language in the software engineering field for documenting several business processes or workflows.
PermalinkTypes
UML diagrams have 2 main categories :
- Behavioral UML Diagrams
- Structural UML Diagrams Each one of them is divided into subcategories.
PermalinkBehavioral UML Diagrams
They are used to visualize and document the dynamic aspects of a system. They show how the system behaves and how it interacts with other entities including the user and the other systems.
They show how data moves through the system, and the passage of time effect on the system, and the events causing the system to change its internal states.
PermalinkTypes
- Activity Diagram
- Use Case Diagram
- State Machine Diagram
- Sequence Diagram
- Timing Diagram
- Interaction Overview Diagram
- Communication Diagram
PermalinkActivity Diagram
It is used to describe the flow of different activities and actions in a system which can be at different levels of abstraction.
They describe the relationship between different activities, and the objects used or consumed or produced by the activity.
PermalinkExample
We want to represent actions, conditions, and transitions in the system then we can represent them like this.
Note that the System ends only if the condition result is "Yes" (accept and go to "Action C").
PermalinkUse Case Diagram
It is used to analyze the system’s requirements in a high-level approach. It enables us to relate what we need from a system to how the system will deliver on those needs.
Every use case diagram consists of 3 parts :
- Functional requirements : are represented as use cases. They are the actions to be done by the actuators.
- Actors : We can call them the game players or the ones who control events. They can be humans, an organization, or internal or external applications.
- Relationships : are between actors and use cases. They are represented using straight arrows. All the actors don't have to have the same access control over the same actions.
PermalinkExample
We can have a "Store" with only two actors :
- Buyer
- Seller
There are 3 actions (functional requirements) that can happen in :
- Say "Hello". --> (done by Buyer, and Seller )
- Buy a product. --> (done by Buyer )
- Sell a product. --> (done by Seller )
PermalinkState Machine Diagram
It is used to describe the different states of an object in a system.
It is named "state machine" because the diagram represents a machine that describes the several states of an object with its changes based on external and internal events.
An object responds differently to the same event depending on what state it is in.
PermalinkExample
We can use it for describing a chess game where with every move for both of the opponents the state of the game changes as the move may lead to a stalemate or a checkmate for any of the players.
PermalinkSequence Diagram
It shows the sequence of interactions and communication (messages and requests passing) between actors and objects.
Objects (actors) can be active only when needed or when there is another object that wants to communicate with them.
It shows the object time when it is needed, and the time interval for it described in the diagram makes the sequence diagrams special.
PermalinkExample
PermalinkClass Diagram
It describes the structure of a system by showing the system's classes, interfaces, and relationships. It is usually used for modeling object-oriented systems.
PermalinkExample
Using the Object-oriented programming approach if we want to describe a human body using a class diagram then it would be like this :
Note that we have only 3 classes and the red text and red arrows are for the explanation.
Thank you, and goodbye.
Subscribe to our newsletter
Read articles from Mohamed Metwalli directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Article Series
Design Patterns
Design Patterns Overview
What are Design Patterns? Design patterns are typical solutions to common problems in software desi…
Singleton Design Pattern
Intent Creating one-of-a-kind objects for which there is only one instance So, it forces us to use t…
Facade Design Pattern
Intent It hides the complexity of the system and provides an interface to the client so the client c…
Observer Design Pattern
Intent It is used when there is a one-to-many relationship between objects. So, if one object is mod…
Builder Design Pattern
Intent It builds a complex object using simple objects and using a step-by-step approach. It allows …
Strategy Design Pattern
Intent It enables us to select an algorithm at runtime. So, Instead of directly implementing a singl…
Factory Method Design Pattern
Intent We create objects without exposing the creation logic to users, we define an interface for cr…
UML Diagrams
What is UML Diagram? UML is an acronym for "Unified Modeling Language". UML is one of the most pop…
Flyweight Design Pattern
Intent It let us fit more objects into the available amount of RAM by reusing already existing simil…
Decorator Design Pattern
Intent It allows us to dynamically add behaviour or a new functionality to an individual object, wit…
Memento Design Pattern
Intent It lets us save and restore the previous state of an object without revealing the details of …
Proxy Design Pattern
Intent A proxy controls access to the original object as It provides a substitute or a placeholder f…