UML (Unified Modeling Language)
UML (Unified Modeling Language)
Goals of UML
Object-Oriented Concepts
UML can be described as the successor of object-oriented (OO) analysis
and design.
An object contains both data and methods that control the data. The data
represents the state of the object. A class describes an object and they
also form a hierarchy to model the real-world system. The hierarchy is
represented as inheritance and the classes can also be associated in
different ways as per the requirement.
Objects are the real-world entities that exist around us and the basic
concepts such as abstraction, encapsulation, inheritance, and
polymorphism all can be represented using UML.
UML is powerful enough to represent all the concepts that exist in object-
oriented analysis and design. UML diagrams are representation of object-
oriented concepts only. Thus, before learning UML, it becomes important
to understand OO concept in detail.
Following are some fundamental concepts of the object-oriented world −
Objects − Objects represent an entity and the basic building block.
Class − Class is the blue print of an object.
Abstraction − Abstraction represents the behavior of an real world entity.
Encapsulation − Encapsulation is the mechanism of binding the data
together and hiding them from the outside world.
Inheritance − Inheritance is the mechanism of making new classes from existing
ones.
Polymorphism − It defines the mechanism to exists in different forms.
2. OO design
The second phase is OO design. During this phase, emphasis is
placed on the requirements and their fulfilment. In this stage, the
objects are collaborated according to their intended association. After
the association is complete, the design is also complete.
3. OO implementation
The third phase is OO implementation. In this phase, the design is
implemented using OO languages such as Java, C++, etc.
● Things
● Relationships
● Diagrams
Things
Things are the most important building blocks of UML. Things can be −
● Structural
● Behavioral
● Grouping
● Annotational
Structural Things
Structural things define the static part of the model. They represent the
physical and conceptual elements. Following are the brief descriptions of
the structural things.
Class − Class represents a set of objects having similar responsibilities.
Use case −Use case represents a set of actions performed by a system for
a specific goal.
Behavioral Things
A behavioral thing consists of the dynamic parts of UML models. Following
are the behavioral things −
Interaction − Interaction is defined as a behavior that consists of a group of
messages exchanged among elements to accomplish a specific task.
State machine − State machine is useful when the state of an object in its
life cycle is important. It defines the sequence of states an object goes
through in response to events. Events are external factors responsible for
state change
Grouping Things
Grouping things can be defined as a mechanism to group elements of a UML
model together. There is only one grouping thing available −
Package − Package is the only one grouping thing available for gathering
structural and behavioral things.
Annotational Things
Annotational things can be defined as a mechanism to capture remarks,
descriptions, and comments of UML model elements. Note - It is the only
one Annotational thing available. A note is used to render comments,
constraints, etc. of an UML element.
Relationship
Relationship is another most important building block of UML. It shows
how the elements are associated with each other and this association
describes the functionality of an application.
There are four kinds of relationships available.
Dependency
Dependency is a relationship between two things in which change in one
element also affects the other.
Association
Association is basically a set of links that connects the elements of a UML
model. It also describes how many objects are taking part in that
relationship.
Generalization
Generalization can be defined as a relationship which connects a
specialized element with a generalized element. It basically describes the
inheritance relationship in the world of objects.
Realization
Realization can be defined as a relationship in which two elements are
connected. One element describes some responsibility, which is not
implemented and the other one implements them. This relationship exists
in case of interfaces.
UML Diagrams
UML diagrams are the ultimate output of the entire discussion. All the
elements, relationships are used to make a complete UML diagram and
the diagram represents a system.
The visual effect of the UML diagram is the most important part of the
entire process. All the other elements are used to make it complete.
UML includes the following nine diagrams, the details of which are
described in the subsequent chapters.
● Class diagram
● Object diagram
● Use case diagram
● Sequence diagram
● Collaboration diagram
● Activity diagram
● Statechart diagram
● Deployment diagram
● Component diagram
Architecture of UML
● Design
● Implementation
● Process
● Deployment
The center is the Use Case view which connects all these four. A Use
Case represents the functionality of the system. Hence, other perspectives
are connected with use case.
Design of a system consists of classes, interfaces, and collaboration. UML
provides class diagram, object diagram to support this.
Implementation defines the components assembled together to make a
complete physical system. UML component diagram is used to support the
implementation perspective.
Process defines the flow of the system. Hence, the same elements as
used in Design are also used to support this perspective.
Deployment represents the physical nodes of the system that forms the
hardware. UML deployment diagram is used to support this perspective.