Unified Modeling Language (UML) is a general purpose modelling language whose main purpose is to to define a standard way to visualize how a software application/system is to be designed.
UML is an approved standard since 2005 which makes it easy to find tools and users which can share documents between users.
UML is not a programming language, but a visually descriptive system. Generally it can be broken down into two main types:
- Structural Diagrams – covers static components and structure of a system using:
- Component Diagrams,
- Object Diagrams,
- Class Diagrams,
- Package Diagrams, and
- Deployment Diagrams.
- Behavior Diagrams – covers the dynamic aspects or behavior of the system including:
- Use Case Diagrams,
- State Diagrams,
- Activity Diagrams and
- Interaction Diagrams.
Since this course is covering Java and Object Oriented design, we will focus on the structural diagrams.
Object Oriented Concepts Used in UML
- Class – A class defines the blue print i.e. structure and functions of an object.
- Objects – Objects help us to decompose large systems and help us to modularize our system. Modularity helps to divide our system into understandable components so that we can build our system piece by piece. An object is the fundamental unit (building block) of a system which is used to depict an entity.
- Inheritance – Inheritance is a mechanism by which child classes inherit the properties of their parent classes.
- Abstraction – Mechanism by which implementation details are hidden from user.
- Encapsulation – Binding data together and protecting it from the outer world is referred to as encapsulation.
- Polymorphism – Mechanism by which functions or entities are able to exist in different forms.
Structural UML Diagrams
- Class Diagram – This is the most widely use UML diagram. It is the building block of all object oriented software systems. We use class diagrams to show the structure of a system by showing its classes, methods and attributes. Class diagrams can also help us identify relationships between different classes or objects.
- Composite Structure Diagram – are used to represent the internal structure of a class and how it interacts with other parts of the system. They represent internal structure of a structured classifier making the use of parts, ports, and connectors. We can also model collaborations using composite structure diagrams. They are similar to class diagrams except they represent individual parts in detail as compared to the entire class.
- Object Diagram – can be thought of as a screenshot of the instances in a system and the relationship that exists between them. Since object diagrams depict behavior when objects have been instantiated, we are able to study the behavior of the system at a particular instant. An object diagram is similar to a class diagram except it shows the instances of classes in the system. They represent specific instances of classes and relationships between them at a point of time.
- Component Diagram – are used to represent the how the physical components in a system have been organized. We use them for modelling implementation details. Component Diagrams depict the structural relationship between software system elements and help us in understanding if functional requirements have been covered by planned development. They become essential to use when we design and build complex systems.
- Deployment Diagram – are used to represent system hardware and its software.It tells us what hardware components exist and what software components run on them.
- Package Diagram – depict how packages and their elements have been organized. It simply shows us the dependencies between different packages and internal composition of packages. Packages help us to organize UML diagrams into meaningful groups and make the diagram easy to understand. They are primarily used to organize class and use case diagrams and are seen in larger projects, but may be absent where only a single package would exist in a smaller project.
Is UML Still Relevant/Important
The use of UML has declined in recent years because of the influence of Agile development. The major problem with UML or any other similar modeling language is that it requires doing a large part of the design upfront to be most useful, where Agile Development is often planned right before the implementation, and the design/planning phase is ongoing through out the development.
That doesn’t mean that UML isn’t still important, especially to students who need to learn how to plan and develop classes correctly. With experience you will be able to develop classes on demand as would be required by agile development, but until then, planning a project out is more important.
An Intro to UML was originally found on Access 2 Learn