UML Elearning

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 20

UML is a standard language for specifying, visualizing, constructing, and documenting

the artifacts of software systems. It is also used for business modeling and other non-
software systems.
The features of UML are as follows:
• Represents a collection of best engineering practices that have proven successful
in the modeling of large and complex systems.
• It also offers a standard way to write blueprints of a system. It includes conceptual
things, such as business processes and system functions. It also offers concrete
things, such as programming language statements, database schema, and reusable
software components.

The advantages of the UML are as follows:


• The UML provides the user with a ready-to-use, expressive visual modeling
language so that they can develop and exchange meaningful models.
• It offers extensibility and specialization mechanisms to extend the core concepts.
• It is independent of particular programming languages and development
processes.
• It provides a formal basis for understanding the modeling language.
• It supports higher-level development concepts, such as collaborations, framework,
patterns, and components.
• It also integrates the best practices.

The different types of UML diagrams are as follows:


1. Use case diagram
2. Class diagram
3. Interaction diagrams, such as sequence and collaboration
4. State diagram
5. Activity diagram
6. Physical diagrams, such as component and deployment

The two main components of a use case diagram are use cases and actors.
1. The use case:
Is an external view of the system that represents the action performed to
complete a task.
It also describes a sequence of actions that provides value to an actor.

2. An actor represents a user or another system that will interact with the
system that you are modeling.
• The illustration displays the relationship between actors and use cases.

To draw a use case diagram, start by listing all the users of the system. Then, think
from the user’s perspective and list all the functionalities a user might want a system
to provide.

For example, consider a library management system.


First, identify all the users of the system, such as librarian, reader, and others.
List the functionalities that an actor wants the system to provide, such as issuing the
books, returning the books, purchasing the books, and browsing the catalog and view
list.
A class diagram shows the existence of classes and their relationships in the logical
view of a system.
The UML modeling elements in class diagrams are as follows:
• Classes, their structure and behavior
• Relationship components among the classes, such as association, aggregation,
composition, dependency, and inheritance
• Multiplicity and navigation indicators
• Role names or labels
Class Diagrams use the following UML conventions. The syntax to perform the
operations is displayed here.
In the syntax, static members are underlined, but the instance members are not
underlined.
The parameter list will show each parameter type preceded by a colon. The access
specifiers appear in front of each member.
The table displayed here represents the various access specifiers.
In a class diagram, classes and objects are related in different types. They are as
follows:
• Association
• Aggregation
• Composition
• Inheritance
• Dependency
• Instantiation

An association relationship of a class diagram denotes a structural connection between


two classes.
• It shows a bi–directional connection between two classes.
• It is a weak coupling, as associated classes remain independent of each other.

An illustration for an association relationship is displayed here.


Example of class diagram:

There are two kinds of interaction diagrams. They are as follows:


• Sequence diagram, which is an interaction diagram that emphasizes the time
ordering of messages.
• Collaboration diagram, which is an interaction diagram emphasizing the
organization of objects participating in the interaction.
An example for a sequence diagram is displayed here:

A collaboration diagram illustrates the interaction between the objects by using a


static spatial structure. Numbering the messages indicates the sequence of messages.
The UML uses a decimal numbering scheme.
The components of a collaboration diagram are as follows:
• Links: It is represented by a continuous line between objects, and it indicates
the exchange of messages.
• Named objects
• Messages

A collaboration diagram illustrates the interaction between the objects by using a static
spatial structure. Numbering the messages indicates the sequence of messages. The UML
uses a decimal numbering scheme.
The components of a collaboration diagram are as follows:
• Links: It is represented by a continuous line between objects, and it indicates the
exchange of messages.
• Named objects
• Messages
An example for a collaboration diagram is displayed here.

In this session, you have learned that:


• UML is a standard language for specifying, visualizing, constructing, and
documenting the artifacts of software systems
• UML represents higher-level development concepts, such as collaborations,
framework, patterns, and components
• A use case diagram displays the relationship among actors and use cases
• A class diagram shows the existence of classes and their relationships in the
logical view of a system
• Interaction diagrams describe how groups of objects collaborate to accomplish
the tasks within the operation of the system
Advanced UML Diagrams:

State diagrams are used to describe the behavior of a system.


• They describe all the possible states of an object as events occur.
• Each diagram usually represents objects of a single class.
• State diagrams track the different states of its objects through the system.

The components of a state diagram are as follows:


• State
• Event
• State transition
• Action

The example diagram displayed here models the login part of an online banking system.

Logging in consists of entering a valid social security number, personal id number, and
then submitting the information for validation.
Logging in can be factored into four non-overlapping states: Getting SSN, Getting PIN,
Validating, and Rejecting. From each state comes a complete set of transitions that
determine the subsequent state.
In the given example,
• States are represented with the rounded rectangles.
• Transitions are represented by the arrows from one state to another.
• Events or conditions that trigger transitions are written beside the arrows.
• In the illustration, there are two self-transitions, one on Getting SSN and another
on Getting PIN.
• The initial state, that is, the black circle is a dummy to start the action.
• Final states are also dummy states that terminate the action.

The action that occurs as a result of an event or condition is expressed in the form of
action. While in its validating state, the object does not wait for an outside event to
trigger a transition. Instead, it performs an activity. The result of that activity determines
its subsequent state.
• An activity diagram is used to model a single operation of a business process.
• While a state chart diagram focuses attention on an object undergoing a process,
an activity diagram focuses on the flow of activities involved in a single process.
• The activity diagram shows how those activities depend on one another.
• It is used to describe a complicated algorithm.
• It is also used to model applications with parallel processes.

The components of an activity diagram are as follows:


• Activities
• Transitions
• Decision points or branches
• Synchronization bars
An illustration for an activity diagram is displayed here.
This illustration depicts the functions of withdrawing money from a bank account
through an ATM.
• An activity diagram can be divided into object swim lanes that determine the
responsibility of the objects.
• A single transition comes out of each activity, connecting it to the next activity.
• A transition may branch into two or more mutually exclusive transitions.
• Guard expressions (inside [ ]) label the transitions coming out of a branch.
• A branch and its subsequent merge, which marks the end of the branch, appear in
the diagram as hollow diamonds.
• A transition may fork into two or more parallel activities.
The fork and the subsequent join of the threads, which come out of the fork, appear in the
diagram as solid bars.
Physical diagrams are of two types. They are as follows:
• Component diagram
• Deployment diagram

COMPONENT DIAGRAM

• A component diagram illustrates the organization and dependencies among


software components.
• This diagram displays how software components, including source code, binary
code, and executable components are related.
• This has components (A component represents physical packaging of a code
module) and dependencies that are the relationships.

A component is as follows:
• A source code component
• A run-time component
• An executable component

DEPLOYMENT DIAGRAM

• A deployment diagram shows the physical relationship between software and


hardware in a system.
• These diagrams include nodes, which represent a computational unit; in most
cases, a piece of hardware.
• It also includes connections between nodes, which shows the communication path
over the system.

For example, the connections may represent direct hardware coupling line RS-232 cable.
An Ethernet connection may also represent indirect coupling, such as satellite-to-ground
communication.

An example for a physical diagram is displayed here.


In this session, you have learned that:
• State diagrams are used to describe the behavior of a system
• An activity diagram is used to model a single operation of a business process
• The two types of physical diagrams are component and deployment

You might also like