What is UML And Why Learning It Can Make You A Better Developer

img_0988

Before I took the class “Object Oriented Analysis and Design with UML” last semester, I used to put minimal thought into every single component and overall structure at the start of any new project I was going to code. As the eager beginner I still am, I was simply excited to start writing code and would always figure out the structure as I went along.

After discovering UML, I can’t imagine myself writing a well-structured program without it. Don’t get me wrong, I’m still jumping in head first into coding daily. But simply because I’m still learning and need all the practice possible through quick and simple coding challenges. Applying UML on those would be an overkill. But for actual functioning projects that have a specific task (or multiple tasks) to accomplish, UML is the difference between starting a project feeling directionless, and starting one knowing exactly what objects, classes, and code you need to write three weeks from the project start date to get where you want to go.

img_0993

What is UML?

UML stands for Unified Modeling Language, and it is a language used to map out things like the components of a system, the relationships between said components, and how the system will perform.  All of this is done through the use of multiple types of diagrams that adhere to specific notation so that everyone who is familiar with UML can understand how your program needs to be built and how it is expected to run.

UML was created in the late 90’s by Grady Booch, Ivar Jacobson, and Jim Rumbaugh. As the creators of the language, they had a set of seven goals that they expected UML to meet. They are as follows:

  1. Provide an expressive visual modeling language so that users can create meaningful models and exchange them with ease among one another.
  2. Provide mechanisms of specialization to extend the core concepts without the need to redefine these core concepts for each specific area.
  3. Be completely independent of programming language or development process. The Unified Modeling Language can be applied to multiple programming language and can support a variety of different development methods.
  4. Provide a precise yet simple formal basis for users to comprehend the modeling language and what it is trying to convey.
  5. Encourage the growth of the Object Oriented tools market.
  6. Support higher-level development concepts such as collaborations, frameworks, patterns and components, in order to accurately represent programs and processes.
  7. Integrate the best practices in the industry when it comes to levels of architectures, abstraction, life cycle stages, domains, etc.
img_0990

 Diagrams That Make Up UML

Each diagram has a very specific purpose, and through the use of all or some of these you will be able to go from an application, system, or software idea to a fully fleshed out plan.

CLASS DIAGRAM

UML Class diagram for an air transportation system
Class diagram for an air transportation system

As the name indicates, the class diagram is designed to depict classes (along with their attributes and methods) and three of the main object oriented constructs that rule the relationships among them: the association structure, the inheritance structure, and the whole/part association.

USE CASE DIAGRAM

A simple use case diagram for a library system

The use case diagram depicts the system or application, the actors involved in the interaction with it (example: user, customer, server, etc), and the associations that take place. This diagram is useful to show complex ideas in an understandable way that would be difficult to convey otherwise.

SEQUENCE DIAGRAM

Sequence diagram for the “make flight reservation” use case

The sequence diagram shows in a concise and simplified way the interactions that take place between each actor within the use case diagram in order to complete one full use case (also called a scenario). For instance, the steps taken so that a customer can successfully book a flight.

ACTIVITY DIAGRAM

Activity diagram for logging into an email system

The activity diagram is essentially a flow chart that depicts the sequence of steps from one activity to the next so as to complete a whole algorithm or work flow from beginning to end.

STATE DIAGRAM

State diagram for a game of tic tac toe

The state diagram depicts the different transformations of an object. For example, the process of setting the time on a digital watch.

Where Can I Learn UML?

Being introduced to all the various ways of organizing my ideas for a specific project was a big game changer for me. If you are a self taught developer, or haven’t studied UML at school yet, I really want to encourage you to take some time to learn this simple, yet very powerful modeling language. It will help you compartmentalize different portions of your program and develop more crisp ideas. But another huge benefit is that it will allow you to communicate your abstract ideas more clearly to a team of developers, investors, or anyone else who will be involved in the process of bringing your application or system to life.

If you want to explore UML further here are some useful resources for you to check out:

I will also be following up this article with a series of posts dedicated to each diagram, sharing some of my own diagrams and more in-depth explanations of how each one is created.

During the mean time, you can download the cheatsheets I created while taking this course right here:

DOWNLOAD UML CHEATSHEET

pinterest-image

______________________________________

Sources:

Page-Jones, Meilir. Fundamentals Of Object-Oriented Design in UML. New York: Dorset House, 2000. Print

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.