The Unified Modeling Language (UML) is a standard language for software engineers who need to describe, discuss, and evolve the structure and behavior of a software system.
What UML standardizes
UML provides a shared notation for visualizing a system design. It lets you represent concepts, their data, and their relationships in diagrams and models so that developers and domain experts can discuss the same system description.
UML was created by Grady Booch, Ivar Jacobson, and James Rumbaugh at Rational Software during 1994–1995, with further development through 1996. The standard is intended to help you reason about, visualize, specify, and document artifacts of software-intensive systems.
For example, a car-registration system can use UML to state that a Car has a license-plate number and is related to one Brand. This describes the concepts in the system independently of whether you later implement it with a web application, a desktop application, or another technical architecture.
UML describes the system gist
The system gist is the essential description of what makes one system distinct from another. In software, this is usually the domain concepts, their rules, and their relationships.
UML helps you keep system gist separate from two other kinds of decisions:
| Area | What it concerns | Example |
|---|---|---|
| System gist | What the system is about | A Booking connects a Person and a Flight.
|
| Modernity | Current tools, frameworks, and implementation strategies | Whether the application uses a particular persistence framework or hosting platform. |
| Fashion | Choices driven by preference, market expectations, or visual trends | The visual style and interaction patterns selected for a mobile user interface. |
Use UML to make the system gist explicit in the language of the domain. For example, model Flight, Passenger, and Booking rather than beginning with database tables or UI widgets. A model stated this way is easier to discuss, maintain, and evolve as technical choices change.
Class diagrams
A UML class diagram is the preferred UML representation for describing information. It shows classes, their attributes, and their associations.
A class is a concept; an object is an instance of that class. For example, Car is a class, while a particular car with license plate ABC123 is an object of class Car.
An attribute stores information for each object and has a type. For example:
Car
LicensePlate : String
An association, also called a relation or link, connects classes. Association ends have names and cardinality, which states how many objects may participate at that end.
Car * ---- 1 Brand
Read this as: a Car has one Brand, and a Brand can have many cars. Common cardinalities include 0..1 for zero or one, 1 for exactly one, and * for an unlimited number.
When the relationship itself needs information, use an association class. For example, model Booking as an association class between Person and Flight when the booking has its own data or must be unique for each person-flight pair.
A model has a purpose
A model is a simplified representation of real concepts. Its correctness depends on whether it fulfills its stated purpose, not on whether it copies every detail of reality.
For example, you can model a car's brand as a text attribute:
Car
Brand : String
Or you can model Brand as its own class and relate cars to it. The second model avoids repeating a value such as Plymouth for every car and gives you a place to store information about the brand. It is the better model when brands are concepts that the system needs to manage.
UML in MDriven
MDriven Designer uses UML models as the basis for describing the information structure of an application. You define classes, attributes, and associations to capture the domain, then use the model together with ViewModels to describe how users work with that information.
For example, a sales application can model Customer, Order, and OrderLine. A ViewModel can present a customer's orders and their lines, while the UML model retains the definitions of the concepts and their relationships.
UML supports thinking from multiple perspectives. You can create diagrams to focus on a particular part of a model and discard a diagram when it no longer helps. Removing a diagram does not remove the classes and associations defined in the underlying model.
