The document provides an overview of the Unified Modeling Language (UML). UML is a general-purpose modeling language that is used to specify, visualize, construct, and document the artifacts of software systems. The document discusses the various UML diagrams including use case diagrams, class diagrams, sequence diagrams, state machine diagrams, activity diagrams, and package diagrams. It explains the key elements and concepts of each diagram type.
2. GO TO USER ROLES PAGE
Many Stakeholders , many views
Architecture may be many things to many different stakeholders
End user
Project Manager
System Engineer
Developer
Tester
Maintainer
Multidimensional Reality
Many Stakeholders
multiple views , multiple blueprints
3. GO TO USER ROLES PAGE
Models
Modeling is the designing of software applications before coding.
Models are the higher level of abstraction of the System.
A model plays the analogous role in software development that blueprints and
other plans (site maps, elevations, physical models) play in the building of a
skyscraper.
Modeling is the only way to visualize the design and check it against
requirements before one starts to code.
Models are also the vehicle for communication with various stake holders.
4. GO TO USER ROLES PAGE
What is UML?
General-purpose modeling language
Helps to specify, visualize, and document models of software systems
High Level abstraction of the system
Represents the system using Graphical Notations from various Perspectives
used for business modeling and modeling of other non-software systems too
UML 2.0
5. GO TO USER ROLES PAGE
Evolution of UML
Successor to the wave of Object Oriented Analysis and
Design(OOA&D).
unifies the notations used by three amigos(Grady Booch, Ivar
Jacobson and James Rumbaugh) in their OO methods.
OMG
6. GO TO USER ROLES PAGE
Different Perspectives of System
7. GO TO USER ROLES PAGE
Basic OO Terms
A model is an abstraction of the underlying problem.
The domain is the actual world from which the problem comes.
Models consist of objects that interact by sending each other messages.
Objects have things they know (attributes) and things they can do (behaviors
or operations).
The values of an object's attributes determine its state.
Classes are the "blueprints" for objects. A class wraps attributes (data) and
behaviors (methods or functions) into a single distinct entity. Objects are
instances of classes.
8. GO TO USER ROLES PAGE
The Unified Modelling Language – 1.4
Structural Diagrams- class,object,component,deployment diagrams.
Behavioural Diagrams – Use Case , Activity and State Chart diagrams.
Interaction Diagrams – Sequence and Collaboration diagrams.
Use Case
Diagrams
Use Case
Diagrams
Use Case
Diagrams
Scenario
Diagrams
Scenario
Diagrams
Collaboration
Diagrams
State
Diagrams
State
Diagrams
Component
Diagrams
Component
Diagrams
Component
Diagrams
Deployment
Diagrams
State
Diagrams
State
Diagrams
Object
Diagrams
Scenario
Diagrams
Scenario
Diagrams
Statechart
Diagrams
Use Case
Diagrams
Use Case
Diagrams
Sequence
Diagrams
State
Diagrams
State
Diagrams
Class
Diagrams
Activity
Diagrams
Models
9. GO TO USER ROLES PAGE
USE CASE DIAGRAM
Outsider's view of a system.
Emphasizes on what a system does rather than how.
Use case diagrams are the collection of scenarios.
A scenario is an example of what happens when someone(Actor)
interacts with the system.
Scenarios together accomplishes a specific goal of the user.
Every use case diagram has actors, use cases, and communications.
10. GO TO USER ROLES PAGE
Use Case Modeling: Core Elements
Introduction to UML
10
Construct Description Syntax
use case A sequence of actions, including
variants, that a system (or other
entity) can perform, interacting with
actors of the system.
actor A coherent set of roles that users
of use cases play when interacting
with these use cases.
system
boundary
Represents the boundary between
the physical system and the actors
who interact with the physical
system.
UseCaseName
ActorName
11. GO TO USER ROLES PAGE
Use Case Modeling: Core Relationships
Introduction to UML
11
Construct Description Syntax
association The participation of an actor in a use
case. i.e., instance of an actor and
instances of a use case communicate
with each other.
extend A relationship from an extension use
case to a base use case, specifying
how the behavior for the extension
use case can be inserted into the
behavior defined for the base use
case.
generalization A taxonomic relationship between a
more general use case and a more
specific use case.
<<extend>>
12. GO TO USER ROLES PAGE
Use Case Modeling: Core Relationships (cont’d)
Introduction to UML
12
Construct Description Syntax
include An relationship from a base use case
to an inclusion use case, specifying
how the behavior for the inclusion use
case is inserted into the behavior
defined for the base use case.
<<include>>
14. GO TO USER ROLES PAGE
Extend and Include Relationship
we can add extend relationships to a model to show the following situations:
A part of a use case that is optional system behavior
A subflow is executed only under certain conditions
A set of behavior segments that may be inserted in a base use case
Include Relationship
The behavior of the inclusion use case is common to two or more use cases.
The result of the behavior that the inclusion use case specifies, not the behavior itself,
is important to the base use case.
15. GO TO USER ROLES PAGE
Example :Use Case Diagram
Introduction to UML
15
16. GO TO USER ROLES PAGE
USE CASE DIAGRAM
Use case diagrams are helpful in three areas.
determining features (requirements).
New use cases often generate new requirements as the
system is analyzed and the design takes shape.
communicating with clients.
Their notational simplicity makes use case diagrams a good
way for developers to communicate with clients.
generating test cases.
The collection of scenarios for a use case may suggest a suite
of test cases for those scenarios.
17. GO TO USER ROLES PAGE
CLASS DIAGRAM
Structural overview of a system by showing its classes and the relationships
among them
Static diagrams
Static relations:
Associations
Subtypes
Static structure:
Attributes
Operations
Created along with use case diagrams
Transition from what? to How?
18. GO TO USER ROLES PAGE
CLASS DIAGRAM- Class
The illustration uses the following UML™
conventions.
• Static members are underlined. Instance
members are not.
• The operations follow this form:
<access specifier> <name> ( <parameter list>) :
<return type>
•The parameter list shows each parameter type
preceded by a colon.
• Access specifiers appear in front of each
member.
19. GO TO USER ROLES PAGE
CLASS DIAGRAM
Class information: visibility and scope
Attributes and operations can be labeled according to access and
scope
Symbol Access
+ public
- private
# protected
20. GO TO USER ROLES PAGE
Class Operations
An operation is the implementation of a service that can be requested from any
object of the class in order to affect behaviour.
Used to manipulate the attributes or to perform other actions.
Operations are normally called functions, but they are inside a class and can be
applied only to objects of that class.
Signature - return-type, a name and zero or more parameters.
The signature describes everything needed to use the operation.
22. GO TO USER ROLES PAGE
Class-Association
Associations are structural relationships where instances (objects) of one class
are connected to instances (objects) of another class.
an employee works for a company
a company has a number of offices
An association is normally bidirectional, which means that if an object is
associated with another object, both objects are aware of each other (navigation
is bidirectional by default).
Binary association connects exactly two classes.
The most common association is just a connection between classes.
23. GO TO USER ROLES PAGE
Association adornments: name, role
The association has a name - the descriptive term, often a verb, for the
association.
Each association has two association ends; each end is attached to one of the
classes in the association. An end can be explicitly named with a label. This
label is called a role name (association ends are often called roles).
24. GO TO USER ROLES PAGE
Reflexive Associations
A class has an association to itself.
Example: A directory may contain other directories.
Directory File
0..1
parent
subdirectory
0..*
1 0..*
25. GO TO USER ROLES PAGE
Class Navigability
A navigability arrow on an association shows which direction the association
can be traversed or queried.
26. GO TO USER ROLES PAGE
Class Associations: multiplicity
Multiplicity defines the number of
objects associated with an instance of
the association.
Default of 1 (1: 1)
0 or 1: 0..1
Zero or more (0..infinite): *
1 or more (1..infinite): 1..*
n..m; range from n to m inclusive
Car Person
transports
passenger
Car Person
transports
passenger
5
Car Person
transports
passenger
*
Car Person
transports
passenger
1..*
Car Person
transports
passenger
2..5
27. GO TO USER ROLES PAGE
Class - Generalization
A specialization / generalization relationship, in which objects of the
specialized element (child) are substitutable for objects of the
generalized element (parent).
Superclass – the generalization of another class, the child.
Subclass – the specialization of another class, the parent.
V
ehicle
WindPowered
V
ehicle
MotorPowered
V
ehicle
Land
Vehicle
Water
V
ehicle
venue
venue
power
power
Sailboat
Truck
{overlapping} {overlapping}
28. GO TO USER ROLES PAGE
Generalization - characteristics
Identify common features concerning behaviour and
knowledge. Define these common features on a higher level in
the inheritance hierarchy.
The aim is at behaviour more than knowledge when combining
classes.
Generalization is a bottom-up process.
A superclass includes all common properties of its subclasses.
29. GO TO USER ROLES PAGE
Specialization - characteristics
Define a new class which is a special appearance of an
existing class.
Specialization is a top-down process.
A subclass can have attributes and operations that are
specific for that sub-class.
A subclass may redefine operations of its super-class
30. GO TO USER ROLES PAGE
Class Diagram - Constraints
The basic constructs of association, attribute, and
generalization do much to specify important constraints.
They cannot indicate every constraint. These constraints
still need to be captured; the class diagram is a good place
to do that.
The UML allows you to use anything to describe
constraints. The only rule is that we put them inside braces
{ }.
32. GO TO USER ROLES PAGE
Aggregation and Composition
Associations in which an object is part of a whole are aggregations.
Composition is a strong association in which the part can belong to
only one whole -- the part cannot exist without the whole.
Composition is denoted by a filled diamond at the whole end.
Computer system
Monitor
Building
Floor
1
1
1
1..*
33. GO TO USER ROLES PAGE
Aggregation and Composition
34. GO TO USER ROLES PAGE
Alternative Notation for Composition
35. GO TO USER ROLES PAGE
Advanced Class Concepts : Abstract
An operation is abstract if it has no implementation.
A abstract class cannot have any direct instances.
Abstract classes only occur in the context of an inheritance
hierarchy.
Abstract operations and classes are specified by writing its
name in italics.
36. GO TO USER ROLES PAGE
Advanced Class Concepts : Abstract cont.
37. GO TO USER ROLES PAGE
Class Diagram with Interfaces
38. GO TO USER ROLES PAGE
Package Diagram
To simplify complex class diagrams, we can group classes into
packages. Packages.
Packages appear as rectangles with small tabs at the top.
The package name is on the tab or inside the rectangle.
The dotted arrows are dependencies.
40. GO TO USER ROLES PAGE
Interaction : Sequence Diagram
Sequence diagrams and Collaboration diagrams
Class and object diagrams are static model views. Interaction
diagrams are dynamic. They describe how objects collaborate.
A sequence diagram is an interaction diagram that details how
operations are carried out -- what messages are sent and when.
Sequence diagrams are organized according to time. The time progresses
as we go down the page.
The Sequence diagram lists objects horizontally, and time vertically, and
models these messages over time.
41. GO TO USER ROLES PAGE
Sequence Diagram : Drawing Elements
Diagram Header Elements
Actor Represents an external person or entity that interacts with the system
Object Represents an object in the system or one of its components
Unit Represents a subsystem, component, unit, or other logical entity in the
system (may or may not be implemented by objects)
Separator Represents an interface or boundary between subsystems,
components or units (e.g., air interface, Internet, network)
Group Groups related header elements into subsystems or components being modeled and
are laid out horizontally at the top of the diagram.
42. GO TO USER ROLES PAGE
Sequence Diagram Body Elements
Message
Synchronous Message
Asynchronous Message
Create Message
Destroy Message
Action
43. GO TO USER ROLES PAGE
Sequence Diagram Body Elements
Block(Loop or Conditional)
Page Break
Return Message
Free Note
Flow Note
Diagram links
44. GO TO USER ROLES PAGE
Interaction : Sequence Diagram
45. GO TO USER ROLES PAGE
Sequence Diagram-Example
48. GO TO USER ROLES PAGE
Usage of Sequence Diagram
Complex interactions between components
components are being developed in parallel by different teams
Supporting Robust interface covering multiple scenarios
Use case elaboration
can be used to flesh out the details of one or more use cases
49. GO TO USER ROLES PAGE
COLLABORATION DIAGRAM
Type of an interaction diagram.
Collaborates the static and dynamic relationship
Focus on Object Roles rather than timing.
Each message in a collaboration diagram has a sequence number.
The Collaboration diagram may be used to:
Describe a specific scenario by depicting the movement of messages between the objects
Show a spatial organization of objects and their interactions, rather than the sequence of
the interactions
51. GO TO USER ROLES PAGE
Sequence Diagram
Reserving a copy of book in Library
52. GO TO USER ROLES PAGE
Collaboration Diagram
Reserving a copy of book in Library
53. GO TO USER ROLES PAGE
STATE CHART DIAGRAM
Objects have behaviors and state.
The state of an object depends on its current activity or condition.
A statechart diagram shows the possible states of the object and the
transitions that cause a change in state.
Our example diagram models the login part of an online banking system.
Logging in consists of entering a valid social security number and personal id
number, 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.
54. GO TO USER ROLES PAGE
State Chart Diagram – Dial Tone
55. GO TO USER ROLES PAGE
STATE CHART DIAGRAM - Login
56. GO TO USER ROLES PAGE
STATE CHART DIAGRAM
States are rounded rectangles.
Transitions are arrows from one state to another.
Events or conditions that trigger transitions are written
beside the arrows.
Uses
The life history of a given class, usecase, operation
The events that cause a transition from one state to another
The actions that result from a state change
57. GO TO USER ROLES PAGE
ACTIVITY DIAGRAM
An activity diagram is essentially a fancy flowchart.
Activity diagrams and statechart diagrams are related.
Statechart diagram focuses attention on an object
undergoing a process (or on a process as an object).
An activity diagram focuses on the flow of activities
involved in a single process. The activity diagram shows the
how those activities depend on one another.
58. GO TO USER ROLES PAGE
Element and its description Symbol
Initial Activity: This shows the starting point or first activity of
the flow.
Activity: Represented by a rectangle with rounded (almost oval)
edges.
Decisions: Similar to flowcharts.
Signal: When an activity sends or receives a message, that activity
is called a signal. Signals are of two types: Input signal (Message
receiving activity) shown by a concave polygon and Output signal
(Message sending activity) shown by a convex polygon.
Concurrent Activities: Some activities occur simultaneously or
in parallel. Such activities are called concurrent activities. For
example, listening to the lecturer and looking at the blackboard is a
parallel activity. This is represented by a horizontal split (thick dark
line) and the two concurrent activities next to each other, and the
horizontal line again to show the end of the parallel activity.
Final Activity: The end of the Activity diagram is shown by a
bull's eye symbol, also called as a final activity.
60. GO TO USER ROLES PAGE
Activity Diagram - Example
61. GO TO USER ROLES PAGE
Implementation diagrams
Show aspects of model implementation, including source
code structure and run-time implementation structure
Kinds
component diagram
deployment diagram
62. GO TO USER ROLES PAGE
Component Diagram
Introduction to UML
62
Shows the organizations and dependencies among software
components
Components include
source code components
binary code components
executable components
63. GO TO USER ROLES PAGE
Elements of component diagram
Element and its description Symbol
Component: The objects interacting with
each other in the system. Depicted by a
rectangle with the name of the object in it,
preceded by a colon and underlined.
Class/Interface/Object: Similar to the
notations used in class and object diagrams
Realization/Association: Similar to the
relation/association used in class diagrams
65. GO TO USER ROLES PAGE
Deployment Diagram
Introduction to UML
65
Shows the configuration of run-time processing
elements and the software components, processes
and objects that live on them
Deployment diagrams may be used to show which
components may run on which nodes
67. GO TO USER ROLES PAGE
The Current Official UML Specification:
The current official version of UML and its associated specifications can be
downloaded from OMG Specifications Catalog page for Modeling and Metadata
Specifications at
http://www.omg.org/technology/documents/modeling_spec_catalo
g.htm#UML
68. GO TO USER ROLES PAGE
UML Certification
OCUP
OMG Certified UML Professional
Three Certification Levels:
OCUP Fundamental
OCUP Intermediate
OCUP Advanced
Link : http://www.omg.org/uml-certification/
69. GO TO USER ROLES PAGE
References
Web References :
http://www.uml.org/
http://dn.codegear.com/article/31863
http://www-128.ibm.com/developerworks/rational/library/3101.html
http://www.andrew.cmu.edu/course/90-754/umlucdfaq.html
Book References :
UML Distilled by Martin Fowler with kendall Scott, Pearson Education.
User Guide for UML by Grady Booch, Ivar Jacobson and James Rumbaugh