UML Diagrams

UML diagrams or diagrams based on UML (Unified Modeling Language) serve the purpose of visually representing and modeling a system, along with all roles, actions, classes… everything that is important to the system, to understand it, alter it, maintain it.

In the beginning, and when dealing with smaller projects, UML diagrams may seem unnecessary, but as projects grow larger in scale and complexity UML diagrams are very helpful with visualizing logic, detecting possible flaws or errors. They also improve integration between structural models, define the hierarchy of components.

There are two main types of UML diagrams: Structural and Behavioral diagrams. Both of those types have their own sub-types.

Structural diagrams:

  • Class diagram
  • Package diagram
  • Object diagram
  • Component diagram
  • Composite structure diagram
  • Deployment diagram
  • Profile diagram

Behavioral diagrams:

  • Activity diagram
  • Use Case diagram
  • Interaction Overview diagram
  • Timing diagram
  • State Machine diagram
  • Communication diagram
  • Sequence diagram

Not all diagrams are used on a regular basis. Some of the most used diagrams are: Class diagram, Sequence diagram, Use Case diagram.

Class diagram

Most software being created today is based on Object-Oriented Programming, it makes sense that class diagram is one of the most used. This diagram is made up of classes, fields and functions that describe the behavior of that class. There are also connecting lines between classes that represent the relations between them.

Sequence diagram

Sequence diagram is another very popular and highly used UML diagram. It shows in detail how objects in a system interact and communicate. It has an actor, which represents a role that an entity within a system has, lifeline which shows how long is the participation of en entity, activation which is rectangle on a lifeline, and it represents a period in which an entity is doing some operation, as well as messages between lifelines. Messages can be created, destroyed, recursive,  self messages. It can show the duration of a message, and it also has notes, which can contain useful information for modeler.

Use Case diagram

Use Case diagram seems very simple, but it is very important in depicting functional requirements within a system. Three main components of this diagram are:

  • functional requirements
  • actors
  • relationships

Functional requirements represent use cases, actors are entities that interact with a system and relationships are relations between actors and use cases.

UML diagrams may seem complex to draw and use in the beginning. Modeler needs to choose the right diagram and to display correct classes and their attributes, use cases, correct interaction between actors and entities. But once you learn the syntax and get a hold of making UML diagrams they can be very beneficial in modeling the correct system, defining all classes and high-level requirements and interactions and finding flaws and errors before developers start to implement a solution. That way you minimize errors developers can encounter in development phase and make better and more stable system, which in return is going to make clients happy.