UML, a general-purpose modeling language.

Unified Modeling Language (UML) is a general-purpose modeling language. The purpose of UML is to define a standard way to visualize a system and its design. A good analogy for understanding UML would be to think of it as if it were the blueprints of a house, but instead, the blueprints of s system. UML is not a programming language, but rather a set of rules of how to represent a system visually. Using UML makes the system easier to understand for engineers, businessmen and system architects. The following video explains UML very well.

Now, a bit of history of UML. During the 1970s and 1980s, object-oriented modeling languages were starting to emerge, but weren’t numerous yet. However, after that until the end of the decade, the number of object-oriented modeling languages exploded. In 1996, from this huge number of modeling languages, UML was created. UML was created by merging Booch, OOSE and OMT. UML was created by a consortium called The UML Partners, which was lead by Rumbaugh, Jacobson and Booch. The benefits of UML were that it was stable and predictable, developers could rely on this modeling language. During the same time, the Object Management Group (OMG) asked for proposals concerning modeling languages. UML was proposed to OMG and a partnership was formed between The UML Partners and other big software companies such as HP, DEC, IBM and Microsoft. UML 1.0 was created and it quickly became a standard. In 2005, the International Organization for Standardization (ISO) approved UML as a standard. UML is still being updated to this day.

Now that the history is out of the way, why is UML used so much when designing systems? UML provides a standard, no matter which company you work for, you are able to quickly understand the design of a system if you know how to interpret UML. Think of it this way, imagine you are on a trip to Europe, where there are many countries that speak languages that you do not, you will most likely speak English and be spoken to in English. English can sort of be considered a “standard”, at least for the sake of this example. You know that there will be English speakers at common tourist destinations in other countries, this is similar to UML, you know that other developers will be able to understand your system if you express it with UML. Another reason why UML is used is because it isn’t code, businessmen do not understand code. UML is an efficient way to communicate to businessmen the requirements, functionalities and processes of the system. And lastly, UML makes visualizing easier, being able to identify user interactions within the system with just a glance. UML facilitates the design of a system.

Now, multiple types of UML diagrams will be explained. First, sequence diagrams, they show interactions between objects in a system in a sequential order. The vertical axis of a sequence diagram represents the time at which interactions happen. Sequence diagrams help the documentation and understanding of requirements.

Sequence Diagram Example

Image source

Second, there are class diagrams. This is the most widely used diagram and is the backbone of most object-oriented systems. These diagrams are used to show the classes, their methods and their attributes in a system. This type of diagrams also helps to depict how objects interact.

class diagram template for atm system

Image source

Third, there are object diagrams. Object diagrams represent the instance of a class diagram and the relationships between these instances. The main benefit of this type of diagrams is that it lets us see the behavior of a system at a particular instant, since we are working with instances and not classes. Object diagrams are closer to the actual behavior of a system than class diagrams.

UML Object Diagram

Image source

Fourth, state diagrams, which are used to represent a system or part of it at finite instances of time. They are often called state machines. State diagrams model the dynamic behavior of a class and its response to time and external factors. Not every class of a system is included in a state diagram.

UML-State-Diagram

Image source

Fifth, let’s talk about package diagrams. Package diagrams show the structure of a system using packages. A package is a namespace used to group elements that are semantically related. This type of diagram shows dependencies between packages. The main benefit is that multiple classes can be grouped into a package, making the diagram easier to read.

UML package diagram elements - package, import, access, use, merge.

Image source

And for the last type of diagrams that will be talked about in this post we have component diagrams. Component diagrams show the relationship between components in a system. A component refers to multiple classes that represent an independent subsystem, the component can act as an interface to the rest of the system. There is a development approach that uses components as its base, Component-Based Development. Since classes are grouped together, this type of diagram allows you to look at the system from a higher level.

component diagram example

Image source

After all these types of diagrams, I will briefly cover two concepts, GRASP and MVC. General Responsibility Assignment Software Patterns (GRASP) consist of assigning responsibilities to modules of code. GRASP defines problems and solutions as patterns, these patterns can be applied to your own project. GRASP assigns roles to classes, these roles are: controller, information expert, creator, high cohesion, low coupling, polymorphism and protected classes. Next, there’s the Model-View-Controller Pattern (MVC). A model is an object that carries data. A view is the visualization of the data that the model carries. A controller controls the data flow into a model and updates the view accordingly. A benefit of MVC is simultaneous development, since it is possible to work on the model, view and controller separately.

Thanks to UML, we have a standard way of representing the design of a system. It helps when working with others since, if you use UML, others will be able to understand quickly. Also, there are so many types of diagrams to choose from (even more than the ones that were covered in this post). There will surely be a diagram that fits your needs.

Leave a comment

Design a site like this with WordPress.com
Get started