Unified Modeling Language (UML) Is A Standardized General-Purpose
Unified Modeling Language (UML) Is A Standardized General-Purpose
Unified Modeling Language (UML) Is A Standardized General-Purpose
UML includes a set of graphic notation techniques to create visual models of software-
intensive systems.
Overview
The Unified Modeling Language (UML) is used to specify, visualize, modify, construct and
document the artifacts of an object-oriented software intensive system under development.
[1]
UML offers a standard way to visualize a system's architectural blueprints, including
elements such as:
actors
business processes
(logical) components
activities
programming language statements
database schemas, and
reusable software components.[2]
UML combines techniques from data modeling (entity relationship diagrams), business
modeling (work flows), object modeling, and component modeling. It can be used with all
processes, throughout thesoftware development life cycle, and across different
implementation technologies.[3] UML has synthesized the notations of the Booch method,
the Object-modeling technique (OMT) and Object-oriented software engineering (OOSE) by
fusing them into a single, common and widely usable modeling language. UML aims to be a
standard modeling language which can model concurrent and distributed systems. UML is a
de facto industry standard, and is evolving under the auspices of the Object Management
Group (OMG).
UML models may be automatically transformed to other representations (e.g. Java) by means
of QVT-like transformation languages, supported by the OMG. UML is extensible, offering
the following mechanisms for customization: profiles and stereotype.
Modeling
It is very important to distinguish between the UML model and the set of diagrams of a
system. A diagram is a partial graphic representation of a system's model. The model also
contains documentation that drive the model elements and diagrams (such as written use
cases).
UML models can be exchanged among UML tools by using the XMI interchange format.
Diagrams overview
UML 2.2 has 14 types of diagrams divided into two categories.[6] Seven diagram types
represent structural information, and the other seven represent general types of behavior,
including four that represent different aspects of interactions. These diagrams can be
categorized hierarchically as shown in the following class diagram:
UML does not restrict UML element types to a certain diagram type. In general, every UML
element may appear on almost all types of diagrams; this flexibility has been partially
restricted in UML 2.0. UMLprofiles may define additional diagram types or extend existing
diagrams with additional notations.
In keeping with the tradition of engineering drawings, a comment or note explaining usage,
constraint, or intent is allowed in a UML diagram.
Structure diagrams
Structure diagrams emphasize the things that must be present in the system being modeled.
Since structure diagrams represent the structure they are used extensively in documenting
Structure diagrams
Structure diagrams emphasize the things that must be present in the system being modeled.
Since structure diagrams represent the structure they are used extensively in documenting
the architecture of software systems.
Behaviour diagrams
Behavior diagrams emphasize what must happen in the system being modeled. Since
behavior diagrams illustrate the behavior of a system, they are used extensively to describe
the functionality of software systems.
Interaction diagrams
Interaction diagrams, a subset of behaviour diagrams, emphasize the flow of control and data
among the things in the system being modeled:
Meta modelling
The Object Management Group (OMG) has developed a metamodeling architecture to
define the Unified Modeling Language (UML), called the Meta-Object
Facility (MOF). The Meta-Object Facility is a standard for model-driven engineering,
designed as a four-layered architecture, as shown in the image at right. It provides a
meta-meta model at the top layer, called the M3 layer. This M3-model is the language
used by Meta-Object Facility to build metamodels, called M2-models. The most
prominent example of a Layer 2 Meta-Object Facility model is the UML metamodel,
the model that describes the UML itself. These M2-models describe elements of the
M1-layer, and thus M1-models. These would be, for example, models written in
UML. The last layer is the M0-layer or data layer. It is used to describe runtime
instance of the system.
Beyond the M3-model, the Meta-Object Facility describes the means to create and
manipulate models and metamodels by definingCORBA interfaces that describe those
operations. Because of the similarities between the Meta-Object Facility M3-model
and UML structure models, Meta-Object Facility metamodels are usually modeled as
UML class diagrams. A supporting standard of the Meta-Object Facility is XMI,
which defines an XML-based exchange format for models on the M3-, M2-, or M1-
Layer.
Criticisms
Although UML is a widely recognized and used modeling standard, it is frequently
criticized for the following:
Standards bloat
The problems cited in this section make learning and adopting UML
problematic, especially when required of engineers lacking the
prerequisite skills.[9] In practice, people often draw diagrams with
the symbols provided by their CASE tool, but without the meanings
those symbols are intended to provide.
Linguistic incoherence
History
After Rational Software Corporation hired James Rumbaugh from General Electric in 1994,
the company became the source for the two most popularobject-oriented modeling
approaches of the day: Rumbaugh's Object-modeling technique (OMT), which was better
for object-oriented analysis(OOA), and Grady Booch's Booch method, which was better
for object-oriented design (OOD). They were soon assisted in their efforts by Ivar Jacobson,
the creator of the object-oriented software engineering (OOSE) method. Jacobson joined
Rational in 1995, after his company, Objectory AB[12], was acquired by Rational. The three
methodologists were collectively referred to as the Three Amigos, since they were well
known to argue frequently with each other regarding methodological practices.
In 1996 Rational concluded that the abundance of modeling languages was slowing the
adoption of object technology, so repositioning the work on a unified method, they tasked the
Three Amigos with the development of a non-proprietary Unified Modeling Language.
Representatives of competing object technology companies were consulted
during OOPSLA '96; they chose boxes for representing classes over Grady Booch's Booch
method's notation that used cloud symbols.
Under the technical leadership of the Three Amigos, an international consortium called
the UML Partners was organized in 1996 to complete theUnified Modeling Language
(UML) specification, and propose it as a response to the OMG RFP. The UML Partners'
UML 1.0 specification draft was proposed to the OMG in January 1997. During the same
month the UML Partners formed a Semantics Task Force, chaired by Cris Kobryn and
administered by Ed Eykholt, to finalize the semantics of the specification and integrate it with
other standardization efforts. The result of this work, UML 1.1, was submitted to the OMG in
August 1997 and adopted by the OMG in November 1997.[13]
UML 1.x
As a modeling notation, the influence of the OMT notation dominates (e. g., using rectangles
for classes and objects). Though the Booch "cloud" notation was dropped, the Booch
capability to specify lower-level design detail was embraced. The use case notation from
Objectory and the component notation from Booch were integrated with the rest of the
notation, but the semantic integration was relatively weak in UML 1.1, and was not really
fixed until the UML 2.0 major revision.
Concepts from many other OO methods were also loosely integrated with UML with the
intent that UML would support all OO methods. Many others also contributed, with their
approaches flavouring the many models of the day, including: Tony Wasserman and Peter
Pircher with the "Object-Oriented Structured Design (OOSD)" notation (not a method), Ray
Buhr's "Systems Design with Ada", Archie Bowen's use case and timing analysis, Paul
Ward's data analysis and David Harel's "Statecharts"; as the group tried to ensure broad
coverage in the real-time systems domain. As a result, UML is useful in a variety of
engineering problems, from single process, single user applications to concurrent, distributed
systems, making UML rich but also large.
UML 2.x
UML has matured significantly since UML 1.1. Several minor revisions (UML 1.3, 1.4, and
1.5) fixed shortcomings and bugs with the first version of UML, followed by the UML 2.0
major revision that was adopted by the OMG in 2005[14].
Although UML 2.1 was never released as a formal specification, versions 2.1.1 and 2.1.2
appeared in 2007, followed by UML 2.2 in February 2009. UML 2.3 was formally released in
May 2010[15].
The current versions of these standards follow: UML Superstructure version 2.3, UML
Infrastructure version 2.3, OCL version 2.2, and UML Diagram Interchange version 1.0[16].
Although many UML tools support some of the new features of UML 2.x, the OMG provides
no test suite to objectively test compliance with its specifications.
Activity diagram
UML 1.x Activity diagram for a guided brainstorming process
Construction
Activity diagrams are constructed from a limited repertoire of shapes, connected with arrows.
The most important shape types:
Arrows run from the start towards the end and represent the order in which activities happen.
Hence they can be regarded as a form of flowchart. Typical flowchart techniques lack
constructs for expressing concurrency. However, the join and split symbols in activity
diagrams only resolve this for simple cases; the meaning of the model is not clear when they
are arbitrarily combined with decisions or loops.
While in UML 1.x, activity diagrams were a specialized form of state diagrams, in UML 2.x,
the activity diagrams were reformalized to be based on Petri net-like semantics, increasing
the scope of situations that can be modeled using activity diagrams. These changes cause
many UML 1.x activity diagrams to be interpreted differently in UML 2.x
Applications
In SysML the activity diagram has been extended to indicate flows among steps that convey
physical matter (e.g., gasoline) or energy (e.g., torque, pressure). Additional changes allow
the diagram to better support continuous behaviors and continuous data flows.
Alternatives
In UML 1.x, an alternative to activity diagrams is the UML State diagram, in which states
can be used to represent activities (namely the state of that activity being performed), and
transitions represent the start or completion of activities.
This mapping of activity diagram features to state diagram were formalized in UML 1.x,
leaving activity diagrams little more that the use of state machines to capture behavior and
partially concurrent behavior within a work flow.
Despite the (small) advantages of using UML 1.x activity diagram over state machines, such
as the ability to cover the behaviors of collaborating elements, while state machines are
limited to a single element, many modelers remained using state diagrams. State machines
were attractive to use as the states may also represent conditions that hold before or after the
activities. Activity diagrams and state diagram had similar abilities to express concurrency,
though the run-to-completion (RTC) semantics of State machines limited the expressiveness
of the concurrency.
Perhaps the most important reason why state machines were more popular in UML 1.x over
activity diagrams was that the tool vendors were slow to implement robust activity diagram
capabilities.
With UML 2.x, the foundation of activity diagram changed from being based on state-
machine semantics to now being based on Petri net semantics. This vastly expand the number
of circumstances where activity diagrams are more appropriate to capture the paths of work
flow in a system. Now with the advent of robust activity diagram implementations, activity
diagrams are now generally used more than state machine diagrams.
A use case diagram in the Unified Modeling Language (UML) is a type of behavioral
diagram defined by and created from a Use-case analysis. Its purpose is to present a graphical
overview of the functionality provided by a system in terms of actors, their goals (represented
as use cases), and any dependencies between those use cases.
The main purpose of a use case diagram is to show what system functions are performed for
which actor. Roles of the actors in the system can be depicted.
Overview
Use Case diagrams are formally included in two modeling languages defined by the OMG:
the Unified Modeling Language (UML) and the Systems Modeling Language (SysML).
Interaction among actors is not shown on the use case diagram. If this interaction is essential
to a coherent description of the desired behavior, perhaps the system or use case boundaries
should be re-examined. Alternatively, interaction among actors can be part of the
assumptions used in the use case.
Actor Generalization
Include
In one form of interaction, a given use case may include another. "Include is a Directed
Relationship between two use cases, implying that the behavior of the included use case is
inserted into the behavior of the including use case"[4].
The first use case often depends on the outcome of the included use case. This is useful for
extracting truly common behaviors from multiple use cases into a single description. The
notation is a dashed arrow from the including to the included use case, with the label
"«include»". This usage resembles a macro expansion where the included use case behavior
is placed inline in the base use case behavior. There are no parameters or return values. To
specify the location in a flow of events in which the base use case includes the behavior of
another, you simply write include followed by the name of use case you want to include, as in
the following flow for track order.
Extend
In another form of interaction, a given use case (the extension) may extend another. This
relationship indicates that the behavior of the extension use case may be inserted in the
extended use case under some conditions[1]. The notation is a dashed arrow from the
extension to the extended use case, with the label "«extend»". The notes or constraints may
be associated with this relationship to illustrate the conditions under which this behavior will
be executed.
Modelers use the «extend» relationship to indicate use cases that are "optional" to the base
use case. Depending on the modeler's approach "optional" may mean "potentially not
executed with the base use case" or it may mean "not required to achieve the base use case
goal".
Generalization
Sequence diagram
Sequence diagrams are sometimes called event diagrams, event scenarios, and timing
diagrams.[1]
Overview
A sequence diagram shows, as parallel vertical lines (lifelines), different processes or objects
that live simultaneously, and, as horizontal arrows, the messages exchanged between them, in
the order in which they occur. This allows the specification of simple runtime scenarios in a
graphical manner.
For instance, the UML 1.x diagram on the right describes the sequences of messages of a
(simple) restaurant system. This diagram represents a Patron ordering food and wine,
drinking wine then eating the food, and finally paying for the food. The dotted lines
extending downwards indicate the timeline. Time flows from top to bottom. The arrows
represent messages (stimuli) from an actor or object to other objects. For example, the Patron
sends message 'pay' to the Cashier. Half arrows indicate asynchronous method calls.
The UML 2.0 Sequence Diagram supports similar notation to the UML 1.x Sequence
Diagram with added support for modeling variations to the standard flow of events.
Diagram building blocks
If the lifeline is that of an object, it demonstrates a role. Note that leaving the instance name
blank can represent anonymous and unnamed instances.
In order to display interaction, messages are used. These are horizontal arrows with the
message name written above them. Solid arrows with full heads are synchronous calls, solid
arrows with stick heads are asynchronous calls and dashed arrows with stick heads are return
messages. This definition is true as of UML 2, considerably different from UML 1.x.
Activation boxes, or method-call boxes, are opaque rectangles drawn on top of lifelines to
represent that processes are being performed in response to the message
(ExecutionSpecifications in UML).
Objects calling methods on themselves use messages and add new activation boxes on top of
any others to indicate a further level of processing.
When an object is destroyed (removed from memory), an X is drawn on top of the lifeline,
and the dashed line ceases to be drawn below it (this is not the case in the first example
though). It should be the result of a message, either from the object itself, or another.
A message sent from outside the diagram can be represented by a message originating from a
filled-in circle (found message in UML) or from a border of sequence diagram (gate in
UML).
Some systems have simple dynamic behavior that can be expressed in terms of specific
sequences of messages between a small, fixed number of objects or processes. In such cases
sequence diagrams can completely specify the system's behavior. Often, behavior is more
complex, e.g. when the set of communicating objects is large or highly variable, when there
are many branch points (e.g. exceptions), when there are complex iterations, or
synchronization issues such as resource contention. In such cases, sequence diagrams cannot
completely describe the system's behavior, but they can specify typical use cases for the
system, small details in its behavior, and simplified overviews of its behavior.
Deployment diagram
A deployment diagram in the Unified Modeling Language models the physical deployment
of artifacts on nodes.[1] To describe a web site, for example, a deployment diagram would
show what hardware components ("nodes") exist (e.g. a web server, an application server,
and a database server), what software components ("artifacts") run on each node (e.g. web
application, database), and how the different pieces are connected (e.g. JDBC, REST, RMI).
The nodes appear as boxes, and the artifacts allocated to each node appear as rectangles
within the boxes. Nodes may have subnodes, which appear as nested boxes. A single node in
a deployment diagram may conceptually represent multiple physical nodes, such as a cluster
of database servers.
Component diagram
In the Unified Modeling Language, a component diagram depicts how components are
wired together to form larger components and or software systems. Components diagrams are
used to illustrate the structure of arbitrarily complex systems.
Overview
An assembly connector is a "connector between two components that defines that one
component provides the services that another component requires. An assembly connector is
a connector that is defined from a required interface or port to a provided interface or port."[1]
When using a component diagram to show the internal structure of a component, the
provided and required interfaces of the encompassing component can delegate to the
corresponding interfaces of the contained components.
A delegation connector is a "connector that links the external contract of a component (as
specified by its ports) to the internal realization of that behavior by the component’s parts."[1]
Package diagram
A package diagram in the Unified Modeling Language depicts the dependencies between
the packages that make up a model.
Overview
package import
package merge
A package merge is "a directed relationship between two packages, that indicates that the
contents of the two packages are to be combined. It is very similar to Generalization in the
sense that the source element conceptually adds the characteristics of the target element to its
own characteristics resulting in an element that combines the characteristics of both"[2]
Usage
Package diagrams can use packages containing use cases to illustrate the functionality of a
software system.
Package diagrams can use packages that represent the different layers of a software system to
illustrate the layered architecture of a software system. The dependencies between these
packages can be adorned with labels / stereotypes to indicate the communication mechanism
between the layers.
Class diagram
Hierarchy of UML 2.0 Diagrams, shown as a class diagram. The individual classes
are represented just with one section, but they often contain up to three
sections.
In software engineering, a class diagram in the Unified Modeling Language (UML) is a type
of static structure diagram that describes the structure of a system by showing the
system's classes, their attributes, and the relationships between the classes.
Overview
The class diagram is the main building block in object oriented modelling. They are being used both
for general conceptual modelling of the systematics of the application, and for detailed
In the system design of a system, a number of classes are identified and grouped together in a
class diagram which helps to determine the statical relations between those objects. With
detailed modeling, the classes of the conceptual design are often split in a number of
subclasses.
In order to further describe the behavior of systems, these class diagrams can be
complemented by state diagram or UML state machine. Also instead of class diagramsObject
role modeling can be used if you just want to model the classes and their relationships.[1]
Members
UML provides mechanisms to represent class members, such as attributes and methods, and
additional information about them.
Visibility
To specify the visibility of a class member (i.e., any attribute or method) there are the
following notations that must be placed before the member's name.[2]:
Scope
The UML specifies two types of scope for members: instance and classifier.[2] In the case of
instance members, the scope is a specific instance. For attributes, it means that its value can
vary between instances. For methods, it means that its invocation affects the instance state, in
other words, affects the instance attributes. Otherwise, in the classifier member, the scope is
the class. For attributes, it means that its value is equal for all instances. For methods, it
means that its invocation does not affect the instance state. Classifier members are commonly
recognized as "static" in many programming languages. To indicate that a member has the
classifier scope, its name must be underlined. Otherwise, as default, the instance scope is
considered.
Relationships
A relationship is a general term covering the specific types of logical connections found on
class and object diagrams. UML shows the following relationships:
External links
A Link is the basic relationship among objects. It is represented as a line connecting two or
more object boxes. It can be shown on an object diagram or class diagram. A link is an
instance of an association. In other words, it creates a relationship between two classes.
Association
An Association represents a family of links. Binary associations (with two ends) are normally
represented as a line, with each end connected to a class box. Higher order associations can
be drawn with more than two ends. In such cases, the ends are connected to a central
diamond.An association can be named, and the ends of an association can be adorned with
role names, ownership indicators, multiplicity, visibility, and other properties. There are five
different types of association. Bi-directional and uni-directional associations are the most
common ones. For instance, a flight class is associated with a plane class bi-directionally.
Associations can only be shown on class diagrams. Association represents the static
relationship shared among the objects of two classes. Example: "department offers courses",
is an association relation.
Aggregation
Aggregation can occur when a class is a collection or container of other classes, but where
the contained classes do not have a strong life cycle dependency on the container—
essentially, if the container is destroyed, its contents are not.
In UML, it is graphically represented as a hollow diamond shape on the containing class end
of the tree of lines that connect contained class(es) to the containing class.
Composition
Class diagram showing Composition between two classes at top and Aggregation
between two classes at bottom
Composition usually has a strong life cycle dependency between instances of the container
class and instances of the contained class(es): If the container is destroyed, normally every
instance that it contains is destroyed as well. Note that a part can (where allowed) be removed
from a composite before the composite is deleted, and thus not be deleted as part of the
composite.
The whole of a composition must have a multiplicity of 0..1 or 1, indicating that a part must
belong to only one whole; the part may have any multiplicity. For example, consider
University and Department classes. A department belongs to only one university, so
University has multiplicity 1 in the relationship. A university can (and will likely) have
multiple departments, so Department has multiplicity 1..*.
Generalization
The Generalization relationship indicates that one of the two related classes (the subtype) is
considered to be a specialized form of the other (the super type) and supertype is considered
as 'Generalization' of subtype. In practice, this means that any instance of the subtype is also
an instance of the supertype. An exemplary tree of generalizations of this form is found
in binomial nomenclature: human beings are a subtype of simian, which are a subtype
of mammal, and so on. The relationship is most easily understood by the phrase 'A is a B' (a
human is a mammal, a mammal is an animal).
The generalization relationship is also known as the inheritance or "is a" relationship.
The subtype in the specialization relationship is also known as the "child", subclass, derived
class, derived type, inheriting class, or inheriting type.
Note that this relationship bears no resemblance to the biological parent/child relationship:
the use of these terms is extremely common, but can be misleading.
Generalization-Specialization relationship
A is a type of B
E. g. "an oak is a type of tree", "an automobile is a type of vehicle"
Generalization can only be shown on class diagrams and on Use case diagrams.
Realization
General Relationship
Class diagram showing dependency between "Car" class and "Wheel" class
Dependency
Dependency is a weaker form of relationship which indicates that one class depends on
another because it uses it at some point of time. Dependency exists if a class is a parameter
variable or local variable of a method of another class.
Multiplicity
The association relationship indicates that (at least) one of the two related classes makes
reference to the other. In contrast with the generalization relationship, this is most easily
understood through the phrase 'A has a B' (a mother cat has kittens, kittens have a mother
cat). The UML representation of an association is a line with an optional arrowhead
indicating the role of the object(s) in the relationship, and an optional notation at each end
indicating the multiplicity of instances of that entity (the number of objects that participate in
the association).
1..3, 6,
Mixed instances
9..*
Analysis Stereotypes
In the early stages of a project's technical analysis, class diagrams can be used to produce
early conceptual models of the system. Classes at this stage often take the form of
boundaries, controls and entities and rarely survive into the design without heavy changes.
Boundaries
Boundary classes handle the communication between actors and the system's internal
components. They might be user interfaces, system interfaces or device interfaces (for
example). They are typically identified by each actor–use-case pair on the system's use-case
diagram.
They are drawn as circles with a short line to the left attached to a vertical line the same
height as the circle (as though it is attached to the side of the use-case system boundary).
Alternatively, they can be drawn as normal classes with the «boundary» stereotype notation
above the class name.
Entities
Entity classes model the information handled by the system, and sometimes the behaviour
associated with the information. They should not be identified as database tables or other
data-stores.
They are drawn as circles with a short line attached to the bottom of the circle. Alternatively,
they can be drawn as normal classes with the «entity» stereotype notation above the class
name
Controls
Control classes handle the flow of control for a use-case and can therefore be seen as co-
ordinating representation classes. These do not do everything in the use case, but co-ordinate
with other classes that can do the work for them.