Copyright

UML Models: Design & Examples

Instructor: Shweta Gadagkar

Shweta holds a Masters Degree in Biochemical Engineering and is a coding enthusiast

The Unified Modeling Language (UML) is widely used in software engineering, in the requirements modeling phase. The following lesson will help you learn about UML models and their design. We will also explore some examples along the way.

Model : A picture is worth a thousand words!

Imagine you were driving to a destination, but missed a turn on your way. Would you prefer to reconfigure your route with the help of a map, or ask for directions? Perhaps, a map would be better, as you would be able to figure out roads and places based on images.

A map could thus be called as a 'model', because it represents the actual places and areas you would come across while driving. Similarly, in software engineering, a model represents a software product.

The Unified Modeling Language (UML)

The UML is a standard language that is used to effectively describe a model, using both visual elements and text, just as in your map.

Note that UML is not a programming language. You can rather call it as a pictorial language consisting of symbols, diagrams, text, pseudo-code or anything that describes a software system. Every stakeholder speaks UML in a software engineering process, particularly during the requirements design phase.

Definition of a UML Model

So, what's a UML model? A UML model is a representation of a software in terms of it's structure, behavior and interactions, before the actual coding process begins. This model is usually used to describe an object oriented programming approach. Considering the complexity of a software product, a UML model is made up of different types of diagrams. Just as the English language consists of 26 alphabets, the UML model diagrams also consist of some basic elements as follows:

  1. Class: You would use this element to describe all the classes your software system would have. A class represents a blueprint for your objects and would contain an object's attributes and behavior.
  2. Object: You would use this element to describe all the objects you would create inside your classes.
  3. Interface: You would use this element to create method signatures without implementing any code, i.e you would just describe the functions of a method. A class would then be able to implement the interface by implementing its functionality.
  4. Collaboration: Using this element, you would describe the interaction between various elements.
  5. Use case: Here, you would describe how a user interacts with the software system.
  6. Node: You would use this element to represent any physical parts of the system , for example , a server.
  7. Package: You would use this element to group similar classes or components together under a namespace.
  8. Note: You would use this element to add comments or explanations in your diagrams.

Design of UML models

Now that we saw the basic elements of a UML model, let's take a look at how UML models are designed.

Any UML model is designed on the basis of the following diagrams :

Structure diagrams

Think of structure diagrams as something used to describe the structure of your software system, i.e. they describe what is present in the system. The different types of structure diagrams are as follows :

Class diagram

You can use a class diagram to represent the actual classes that would be coded later. Let's look at the class diagram for a food ordering software.


Class Diagram
Class diagram


Classes may have different access levels based on access modifiers.


Access modifiers in class diagrams
Access modifiers in class diagrams


Object diagram

An object diagram is visually similar to a class diagram and represents the instances of a class at a given time.


Object diagram for an ice-cream ordering system
Object diagram


Component diagram

It's a diagram that basically shows the relationships between the components of your software system.


Component diagram for an ice-cream ordering system
Component diagram for an ice-cream ordering system


To unlock this lesson you must be a Study.com Member.
Create your account

Register to view this lesson

Are you a student or a teacher?

Unlock Your Education

See for yourself why 30 million people use Study.com

Become a Study.com member and start learning now.
Become a Member  Back
What teachers are saying about Study.com
Try it risk-free for 30 days

Earning College Credit

Did you know… We have over 200 college courses that prepare you to earn credit by exam that is accepted by over 1,500 colleges and universities. You can test out of the first two years of college and save thousands off your degree. Anyone can earn credit-by-exam regardless of age or education level.

To learn more, visit our Earning Credit Page

Transferring credit to the school of your choice

Not sure what college you want to attend yet? Study.com has thousands of articles about every imaginable degree, area of study and career path that can help you find the school that's right for you.

Create an account to start this course today
Try it risk-free for 30 days!
Create an account
Support