I had seen UML diagrams in previous classes, but honestly had no idea it was a language. And I also had no idea I could create my own. Working with UML diagrams in class as well as for homework has been an interesting challenge since it is a language I’ve never seen before. I searched for blogs related to UML and stumbled upon a blog by Suneel Kumar from Medium called, “Understanding UML: The Unified Modeling Language”. It provided me with a much better understanding of UML and how it can be applied to ease the process of designing code.
Unified Modeling Language
Unified Modeling Language, UML for short, is a standardized visual language used to design, document, and communicate complex systems. The creation of the language is credited to Grady Booch, Ivar Jacobson, and James Rumbaugh, who are collectively known as “the Three Amigos”. The three already had their own separate methods: Booch method, Object-Oriented Software Engineering, and Object Modeling Technique. They were combined to create the unified approach. The first version of UML was made in 1997, and the current version, 2.5.1, was made in 2021.
Diagram types
UML has many diagrams designed for different purposes. The different types of diagrams are categorized into two groups, Structural and Behavioral diagrams. Structural diagrams represent the static aspects of the system, while behavioral diagrams represent the dynamic aspects of the system. An example of a structural diagram would be a class diagram. Class diagrams are the UML diagrams that I’ve been most familiar with. It shows the classes in a system, as well as attributes, operations, and relationships between objects. Here is an example of what one would look like:

An example of a behavioral diagram would be a use case diagram. Use case diagrams capture the functional requirements of a system and show the interactions between the user and the system. It would look a little something like this:

Relationships
We touched on the relationships that UML uses a little bit in class, but the blog gave me a clearer explanation of what each one meant.
Association represents a relationship between classes and is generally shown as a simple line. As seen in the diagram below, Person and Car have a relationship since Person must drive the Car. This is shown with a simple line.

Aggregation is a specialized form of association that represents a “whole-part/has-a” relationship. In the diagram below, there is a line with an open “diamond” between Department and Employee. The open “diamond” is on the Department side and indicates that the Department is made up of Employees, but Employees can exist independently of a Department.

Composition is a stronger form of aggregation where the parts cannot exist without the whole. In the following example, house and room are related and there is a filled in diamond on the House side. This represents the relationship as a Room cannot exist without a House.

Inheritance represents an “is-a” relationship. Child classes point to the parent class with a hollow triangle at the end of the line. In the following example, Car and Truck are both types of Vehicle, and is shown with a hollow triangle pointing to vehicle

And realization is often used to show that a class implements an interface. In this example Shape points to Drawable, which is labeled as an interface.

From the blog Blog del William by William Cordor and used with permission of the author. All other rights reserved by the author.