Chapter Two
Chapter Two
Chapter Two
Overview of UML
Building blocks of the UML
Relationships in the UML
UML Diagrams
Overview of UML
3
What is UML?
It is an industry-standard graphical language or modeling
language for specifying, visualizing, constructing, and
documenting the artifacts of software systems.
Goal: provide a standard notation that can be used by
all object-oriented methods
The UML uses mostly graphical notations to express the OO
analysis and design of software projects.
Simplifies the complex process of software design
Help acquire an overall view of a system.
Ont..
4
Model a system:-
1. Describing the system at abstract level to comprehend
its complexity
2. Necessary to manage complexity
3. Good for quick understanding of the systems
4. Less chances of conflicting views b/w end-user and
system designers common understanding
In projects involving many participants, with different
technical and cultural backgrounds,
Accuracy and clarity are critical standard notation
Cont’d
6
2. Diagrams
3. Relationships
1) Things
It can be structural, behavioral, grouping or annotational
Cont’d
9
Structural things:
The Structural things define the static part of the model. They
represent physical and conceptual elements.
Following are the brief descriptions of the structural things.
Class: represents set of objects having similar responsibilities.
Interface: defines a set of operations which specify the responsibility
of a class.
Collaboration: defines interaction between elements.
Use case: represents a set of actions performed by a system for a
specific goal.
Component: a software unit.
Node: can be defined as a physical element that exists at run time
Cont’d
10
Behavioral things:
A behavioral thing consists of the dynamic parts of UML models.
Following are the behavioral things:
Interaction: defined as a behavior that consists of a group of
messages exchanged among elements to accomplish a specific task.
State chart: is useful when the state of an object in its life cycle is
important.
Grouping things:
Grouping things can be defined as a mechanism to group
elements of a UML model together.
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 is the only one Annotational thing available.
Note: is used to render comments, constraints etc of an UML
element.
Cont’d
12
(2) Relationship
Relationship is another most important building block of UML. It
shows how elements are associated with each other and this
association describes the functionality of an application.
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.
UML Diagrams
14
23
24
Cancel NoChange
Example
26
Use Case Diagrams(cont.)
27
•Pay Bill is a parent use case and Bill Insurance is the child use case.
(generalization)
•Both Make Appointment and Request Medication include Check
Patient Record as a subtask.(include)
•The extension point is written inside the base case
Pay bill; the extending class Defer payment adds the behavior of this
extension point. (extend)
Eg.3
28
<<include>>
Add and drop. Check CGPA >2.5 and ECTS <35
With draw. Login, view class…..
29
A use case template for an ATM system
30
31
Cont..
32
Sequence diagram
33
Activation Bars
35
Activity Diagram
36
Activity diagrams show flow of control and data flow. Typically used to
model:
Business process workflow
Flow within a use case
Business rules logic
Functional processes
They are the perfect tool for mapping processes and workflows
Visually presents a series of actions or flow of control in a system similar to
a flowchart.
represents the initial action state or the start point for any activity diagram.
Action Flow:
Synchronization:
It is represented as a straight, slightly
thicker line in an activity diagram.
A fork node is used to split a single
incoming flow into multiple concurrent
flows.
A join node joins multiple concurrent
flows back into a single outgoing flow.
A fork and join node used together are
often referred to as synchronization.
Cont..
40
Time Event:
Attributes
Methods
Cont..
49
example:
1 One only
* Zero or more
3 Three only
Name
* Amount * Has Name
AccountId
CustomerId
AccountId
Deposit()
Withdraw()
GetBalance() CustomerId
The deployment diagram in Figure 8 shows that the users access the
Reporting Tool by using a browser running on their local machine and
connecting via HTTP over their company's intranet to the Reporting Tool.
This tool physically runs on the Application Server named
w3reporting.myco.com. The diagram shows the Reporting Tool component
drawn inside of IBM WebSphere, which in turn is drawn inside of the node
w3.reporting.myco.com. The Reporting Tool connects to its reporting
database using the Java language to IBM DB2's JDBC interface, which then
communicates to the actual DB2 database running on the server named
db1.myco.com using native DB2 communication. In addition to talking to
the reporting database, the Report Tool component communicates via
SOAP over HTTPS to the Billboard Service.
76