Unified Modeling Language (UML)
P.S.Suryateja
Asst. Professor
CSE Department
Vishnu Institute of Technology
The Three Amigos
Vishnu Institute of technology – Website: www.vishnu.edu.in
Outline
Vishnu Institute of technology – Website: www.vishnu.edu.in
Outline (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Prerequisites
Vishnu Institute of technology – Website: www.vishnu.edu.in
Objectives
Vishnu Institute of technology – Website: www.vishnu.edu.in
Outcomes
Vishnu Institute of technology – Website: www.vishnu.edu.in
Software System - Definition
Software [Set of programs]
(Source Code)
Configuration files, system documentation, end-user documentation, test results, maintenance records etc…
+
Vishnu Institute of technology – Website: www.vishnu.edu.in
Software System - Examples
Vishnu Institute of technology – Website: www.vishnu.edu.in
Introduction to Modeling
Vishnu Institute of technology – Website: www.vishnu.edu.in
Modeling
What?
Where?
Why?
How?
Vishnu Institute of technology – Website: www.vishnu.edu.in
Model
Vishnu Institute of technology – Website: www.vishnu.edu.in
Model (cont…)
Construction
Vishnu Institute of technology – Website: www.vishnu.edu.in
Model (cont…)
Software Design
Vishnu Institute of technology – Website: www.vishnu.edu.in
Modeling (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Importance of Modeling
Vishnu Institute of technology – Website: www.vishnu.edu.in
Principles of Modeling
Vishnu Institute of technology – Website: www.vishnu.edu.in
Software Design
Vishnu Institute of technology – Website: www.vishnu.edu.in
Object Oriented Analysis and Design
Vishnu Institute of technology – Website: www.vishnu.edu.in
Object Oriented Modeling
Two approaches for
developing models
Algorithmic
Perspective
Object-Oriented
Perspective
Vishnu Institute of technology – Website: www.vishnu.edu.in
What are Models For?
Vishnu Institute of technology – Website: www.vishnu.edu.in
What are Models For? (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
What is in a Model?
Vishnu Institute of technology – Website: www.vishnu.edu.in
Modeling work process
Ref: UML 2 Tool Kit by Eriksson, Penker, Lyons, Fado
Vishnu Institute of technology – Website: www.vishnu.edu.in
Introduction to UML
Vishnu Institute of technology – Website: www.vishnu.edu.in
UML - Introduction
What?
Where?
Why?
How?
Vishnu Institute of technology – Website: www.vishnu.edu.in
UML – Introduction (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
UML Applicable Domains
Vishnu Institute of technology – Website: www.vishnu.edu.in
Why Unified?
Vishnu Institute of technology – Website: www.vishnu.edu.in
History of UML
Prehistory
Fusion
1st unification
attempt
OMT, Booch, CRC
Booch &
Rumbaugh
(OMT) join
Rational
Jacobson
(Objectory)
joins
Rational
UML
work begins
Object
Management
Group RFP
UML proposal
accepted by
OMG
1994
1995
1996
1997
Schlaer/
Mellor
Booch
Rumbaugh
(OMT)
Jacobson
(Objectory)
Coad/
Yourdon
UML
becomes
an industry
standard
2004
2003
UML 1.x
UML 2.0
Ongoing UML development
Latest Version: 2.4.1
Published on Aug 2011
The Three Amigos
Vishnu Institute of technology – Website: www.vishnu.edu.in
Overview of UML
Vishnu Institute of technology – Website: www.vishnu.edu.in
UML is a Language for Visualizing
Vishnu Institute of technology – Website: www.vishnu.edu.in
UML is a Language for Specifying
Vishnu Institute of technology – Website: www.vishnu.edu.in
UML is a Language for Constructing
Vishnu Institute of technology – Website: www.vishnu.edu.in
Forward Engineering Example
Customer
- cid
- cname
- mobile
+ purchase( )
+ login( )
+ logout( )
+ search( )
class Customer
{
private int cid;
private String cname;
private String mobile;
private String email;
public void purchase( ) { … }
public void login( ) { … }
public void logout( ) { … }
public void search( ) { … }
}
Vishnu Institute of technology – Website: www.vishnu.edu.in
Reverse Engineering Example
class Customer
{
private int cid;
private String cname;
private String mobile;
private String email;
public void purchase( ) { … }
public void login( ) { … }
public void logout( ) { … }
public void search( ) { … }
}
Customer
- cid
- cname
- mobile
+ purchase( )
+ login( )
+ logout( )
+ search( )
Vishnu Institute of technology – Website: www.vishnu.edu.in
Roundtrip Engineering Example
Customer
- cid
- cname
- mobile
+ purchase( )
+ login( )
+ logout( )
+ search( )
class Customer
{
private int cid;
private String cname;
private String mobile;
private String email;
public void purchase( ) { … }
public void login( ) { … }
public void logout( ) { … }
public void search( ) { … }
}
Vishnu Institute of technology – Website: www.vishnu.edu.in
UML is a Language for Documenting
Vishnu Institute of technology – Website: www.vishnu.edu.in
Conceptual Model of UML
Vishnu Institute of technology – Website: www.vishnu.edu.in
Conceptual Model of UML
Vishnu Institute of technology – Website: www.vishnu.edu.in
UML Building Blocks
Vishnu Institute of technology – Website: www.vishnu.edu.in
Structural Things
Vishnu Institute of technology – Website: www.vishnu.edu.in
Behavioral Things
Vishnu Institute of technology – Website: www.vishnu.edu.in
Grouping Things
Vishnu Institute of technology – Website: www.vishnu.edu.in
Annotational Things
Vishnu Institute of technology – Website: www.vishnu.edu.in
Relationships in UML
Dependency
Association
Generalization
Realization
Vishnu Institute of technology – Website: www.vishnu.edu.in
Diagrams
Vishnu Institute of technology – Website: www.vishnu.edu.in
Rules
Vishnu Institute of technology – Website: www.vishnu.edu.in
Common Mechanisms
Vishnu Institute of technology – Website: www.vishnu.edu.in
Software Architecture
Vishnu Institute of technology – Website: www.vishnu.edu.in
Architecture
End user
Integrator
Programmers
& software� managers
System Engineer
Logical View
Development View
Physical View
Developed by Philippe Kruchten
Vishnu Institute of technology – Website: www.vishnu.edu.in
Architecture Vs Design
Overall System (Architecture)
Specific Subsystem (Design)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Unified Process
Vishnu Institute of technology – Website: www.vishnu.edu.in
Software Development Life Cycle
Rational Unified Process (RUP)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Unified Process
Vishnu Institute of technology – Website: www.vishnu.edu.in
RUP - Inception
Inception
Elaboration
Construction
Transition
Requirements – establish business case and scope. Capture core requirements
Analysis – establish feasibility
Design – design proof of concept or technical prototypes
Implementation – build proof of concept or technical prototype
Test – not generally applicable
Focus
Goals
Establish feasibility of the project - create proof of concept/technical prototypes�Create a business case�Scope the system - capture key requirements�Identify critical risks
Vishnu Institute of technology – Website: www.vishnu.edu.in
RUP - Elaboration
Inception
Elaboration
Construction
Transition
Requirements – refine system scope and requirements
Analysis – establish what to build
Design – create a stable architectural baseline
Implementation – build the architectural baseline
Test – test the architectural baseline
Focus
Goals
Create an executable architectural baseline
Refine Risk Assessment and define quality attributes (defect rates etc.)
Capture use cases to 80% of the functional requirements
Create a detailed plan for the construction phase
Formulate a bid which includes resources, time, equipment, staff, cost
Vishnu Institute of technology – Website: www.vishnu.edu.in
RUP - Construction
Inception
Elaboration
Construction
Transition
Requirements – uncover any requirements that had been missed
Analysis – finish the analysis model
Design – finish the design model
Implementation – build the Initial Operational Capability
Test – test the Initial Operational Capability
Focus
Goals
Complete use case identification, description and realization
Finish analysis, design, implementation and test
Maintain the integrity of the system architecture
Revise the Risk Assessment
Vishnu Institute of technology – Website: www.vishnu.edu.in
RUP - Transition
Correct defects
Prepare the user site for the new software and tailor the software to operate at the user site
Modify software if unforeseen problems arise
Create user manuals and other documentation
Provide customer consultancy
Conduct post project review
Inception
Elaboration
Construction
Transition
Requirements – not applicable
Analysis – not applicable
Design – modify the design if problems emerge in beta testing
Implementation – tailor the software for the user site. Fix bugs uncovered in beta testing
Test – perform beta testing and acceptance testing at the user site
Focus
Goals
Vishnu Institute of technology – Website: www.vishnu.edu.in
Hello World Example
Vishnu Institute of technology – Website: www.vishnu.edu.in
Example : Hello World
import java.awt.*;
import java.applet.*;
public class HelloWorld extends Applet
{
public void paint(Graphics g)
{
g.drawString(“Hello World”, 10, 10);
}
}
Vishnu Institute of technology – Website: www.vishnu.edu.in
Example : Hello World (cont…)
HelloWorld
paint( )
g.drawString(“Hello
World”, 10, 10)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Example : Hello World (cont…)
HelloWorld
paint( )
Applet
Graphics
Vishnu Institute of technology – Website: www.vishnu.edu.in
Example : Hello World (cont…)
HelloWorld
Applet
Panel
Container
Component
Object
Vishnu Institute of technology – Website: www.vishnu.edu.in
Example : Hello World (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Structural Modeling
Vishnu Institute of technology – Website: www.vishnu.edu.in
Structural Modeling
Vishnu Institute of technology – Website: www.vishnu.edu.in
Classes
Vishnu Institute of technology – Website: www.vishnu.edu.in
Classes
Vishnu Institute of technology – Website: www.vishnu.edu.in
Classes - Example
Vishnu Institute of technology – Website: www.vishnu.edu.in
Classes - Name
Vishnu Institute of technology – Website: www.vishnu.edu.in
Classes – Name (cont…)
Simple names
Path name
Vishnu Institute of technology – Website: www.vishnu.edu.in
Classes - Attributes
Vishnu Institute of technology – Website: www.vishnu.edu.in
Classes – Attributes (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Classes - Operations
Vishnu Institute of technology – Website: www.vishnu.edu.in
Classes – Operations (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Classes - Responsibilities
Vishnu Institute of technology – Website: www.vishnu.edu.in
Classes – Responsibilities (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Classes – Responsibilities (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Common Modeling Techniques - Modeling the Vocabulary of a System
Vishnu Institute of technology – Website: www.vishnu.edu.in
Common Modeling Techniques - Modeling the Vocabulary of a System
Vishnu Institute of technology – Website: www.vishnu.edu.in
Common Modeling Techniques - Modeling the Distribution of Responsibilities in a System
Vishnu Institute of technology – Website: www.vishnu.edu.in
Common Modeling Techniques - Modeling the Distribution of Responsibilities in a System
Vishnu Institute of technology – Website: www.vishnu.edu.in
Common Modeling Techniques - Modeling Non-software Things
Vishnu Institute of technology – Website: www.vishnu.edu.in
Common Modeling Techniques - Modeling Non-software Things
Vishnu Institute of technology – Website: www.vishnu.edu.in
Common Modeling Techniques - Modeling Primitive Types
Vishnu Institute of technology – Website: www.vishnu.edu.in
Common Modeling Techniques - Modeling Primitive Types
Vishnu Institute of technology – Website: www.vishnu.edu.in
Relationships
Vishnu Institute of technology – Website: www.vishnu.edu.in
Relationships
Vishnu Institute of technology – Website: www.vishnu.edu.in
Relationships - Example
Generalization
Dependency
Association
Vishnu Institute of technology – Website: www.vishnu.edu.in
Dependency
Vishnu Institute of technology – Website: www.vishnu.edu.in
Dependency – Example
Vishnu Institute of technology – Website: www.vishnu.edu.in
Generalization
Vishnu Institute of technology – Website: www.vishnu.edu.in
Generalization (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Association
Vishnu Institute of technology – Website: www.vishnu.edu.in
Association - Name
Vishnu Institute of technology – Website: www.vishnu.edu.in
Association - Role
Vishnu Institute of technology – Website: www.vishnu.edu.in
Association - Multiplicity
Vishnu Institute of technology – Website: www.vishnu.edu.in
Association - Aggregation
Vishnu Institute of technology – Website: www.vishnu.edu.in
Association – Aggregation (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Common Modeling Techniques - Modeling Simple Dependencies
Vishnu Institute of technology – Website: www.vishnu.edu.in
Common Modeling Techniques - Modeling Single Inheritance
Vishnu Institute of technology – Website: www.vishnu.edu.in
Common Modeling Techniques - Modeling Single Inheritance
Vishnu Institute of technology – Website: www.vishnu.edu.in
Common Modeling Techniques - Modeling Structural Relationships
Vishnu Institute of technology – Website: www.vishnu.edu.in
Common Modeling Techniques - Modeling Structural Relationships
Vishnu Institute of technology – Website: www.vishnu.edu.in
Common Mechanisms
Vishnu Institute of technology – Website: www.vishnu.edu.in
Common Mechanisms
Vishnu Institute of technology – Website: www.vishnu.edu.in
Note
Vishnu Institute of technology – Website: www.vishnu.edu.in
Note - Example
Server
Processor: Intel Core i7
RAM: 8GB
HDD: 1PTB
Node
Note
Vishnu Institute of technology – Website: www.vishnu.edu.in
Adornments
Example:
Client
bill.exe
report.exe
contacts.exe
Anonymous
compartment
(Adornment)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Extensibility Mechanisms
Vishnu Institute of technology – Website: www.vishnu.edu.in
Stereotypes
Vishnu Institute of technology – Website: www.vishnu.edu.in
Stereotypes (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Stereotypes - Examples
<<interface>>
Movable
<<exception>>
Underflow
<<Router>>
Digicom AX00
Named
stereotype
Named
stereotype with icon
Stereotyped element as icon
Vishnu Institute of technology – Website: www.vishnu.edu.in
Tagged Values
Vishnu Institute of technology – Website: www.vishnu.edu.in
Tagged Values - Example
Server
{processors = 3}
Tagged value
<<library>>
trans.dll
{serverOnly}
Value of tag
Vishnu Institute of technology – Website: www.vishnu.edu.in
Constraints
Vishnu Institute of technology – Website: www.vishnu.edu.in
Constraints - Example
Bank Account
Person
Corporation
owner
owner
{xor}
constraint
Vishnu Institute of technology – Website: www.vishnu.edu.in
Constraints - Example
Vishnu Institute of technology – Website: www.vishnu.edu.in
Diagrams
Vishnu Institute of technology – Website: www.vishnu.edu.in
Diagrams
Vishnu Institute of technology – Website: www.vishnu.edu.in
Diagrams (cont…)
Diagrams
Structural Diagrams
Behavioral Diagrams
Class Diagrams
Object Diagrams
Implementation Diagrams
Component Diagrams
Deployment Diagrams
Use Case Diagrams
State Chart Diagrams
Activity Diagrams
Interaction Diagrams
Sequence Diagrams
Collaboration Diagrams
Vishnu Institute of technology – Website: www.vishnu.edu.in
Diagrams - Overview
Diagram | Elements | Purpose | View |
Class Diagram | Class, Interface, Collaboration and Relationships | To model the structure/skeleton of the software system | Static design view Static process view (active classes) |
Object Diagram | Objects and Relationships | To model the structure of the software system | Static design view Static process view (active classes) |
Component Diagram | Components and Relationships | To model the components in the software system | Static Implementation view |
Deployment Diagram | Nodes and Relationships | To model the runtime structure of the software system | Static Deployment view |
Use Case Diagram | Use cases, actors and relationships | To model the behavior of the system | Static use case view |
Sequence Diagram | Objects and messages | To model the time ordering of messages | Dynamic view |
Collaboration Diagram | Objects and messages | To model the structural organization of the objects | Dynamic view |
Statechart Diagram | States, transitions, events and activities | To model the behavior as a sequence of state changes | Dynamic view |
Activity Diagram | Activities, transitions and other control flow symbols | To model the behavior as a set of activities | Dynamic view |
Vishnu Institute of technology – Website: www.vishnu.edu.in
Advanced Classes
Vishnu Institute of technology – Website: www.vishnu.edu.in
Classifiers
Vishnu Institute of technology – Website: www.vishnu.edu.in
Classifiers (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Classifiers - Examples
Vishnu Institute of technology – Website: www.vishnu.edu.in
Classifiers – Examples (cont…)
Classifier | Description |
Class | A class is a blueprint or a template for its objects |
Interface | An interface is a collection of operations that must be realized by another element |
Datatype | A type whose values have no identity |
Signal | An asynchronous event communicated between objects |
Component | Physical replaceable part of the system |
Node | A physical existing at runtime which represents a computational resource |
Use case | Collection of actions that a role performs on the system or the system does for a user. |
Sub system | A grouping of elements which specify the behavior of a part of the system |
Vishnu Institute of technology – Website: www.vishnu.edu.in
Advanced Classes
Vishnu Institute of technology – Website: www.vishnu.edu.in
Visibility
Symbol | Name | Description |
+ | Public | Accessible by all other classifiers |
# | Protected | Accessible only by the descendents and the classifier itself |
~ | Package | Accessible by all the classifiers with the same package |
- | Private | Accessible only by the classifier in which they are available |
Vishnu Institute of technology – Website: www.vishnu.edu.in
Visibility - Example
Student
- sid
- sname
- rollno
# mobno
+ register( )
+ login( )
+ logout( )
Vishnu Institute of technology – Website: www.vishnu.edu.in
Scope
Scope | Description |
instance | Each instance of the classifier contains a value of the feature |
classifier | One copy of the feature’s value is shared by all the instances of a classifier |
Vishnu Institute of technology – Website: www.vishnu.edu.in
Scope - Example
Cse Student
- sid
- sname
- rollno
# mobno
+ branch : String = CSE
+ register( )
+ login( )
+ logout( )
Classifier scope
Vishnu Institute of technology – Website: www.vishnu.edu.in
Abstract, Root, Leaf and Polymorphic elements
Vishnu Institute of technology – Website: www.vishnu.edu.in
Abstract, Root, Leaf and Polymorphic elements - Example
Vishnu Institute of technology – Website: www.vishnu.edu.in
Multiplicity
Vishnu Institute of technology – Website: www.vishnu.edu.in
Multiplicity - Example
Car
engine [1]
wheel [4]
door [4]
horn
move()
1
Vishnu Institute of technology – Website: www.vishnu.edu.in
Attributes
[visibility] name [multiplicity] [: type] [=initial value] [{property string}]
Some examples:
origin | Name only |
+ origin | Name and visibility |
origin : Point | Name and type |
head : *Item | Name and complex type |
name [0..1] : String | Name, multiplicity and type |
origin : Point = {0,0} | Name, type and initial value |
id : Integer {frozen} | Name and property |
Vishnu Institute of technology – Website: www.vishnu.edu.in
Attributes (cont…)
changeable | No restrictions on modifying the attributes value |
addOnly | For attributes with multiplicity greater than one, values may be added but not removed or altered once it is created |
frozen | Once created the value of an attribute cannot be changed |
Vishnu Institute of technology – Website: www.vishnu.edu.in
Attributes - Example
Student
- sid {frozen}
- sname
- rollno {frozen}
+ marks {addOnly}
+ register( )
+ login( )
+ logout( )
Vishnu Institute of technology – Website: www.vishnu.edu.in
Operations
[visibility] name [(parameters-list)] [: return-type] [{property-string}]
Some examples:
origin | Name only |
+ origin | Name and visibility |
origin : Point | Name and type |
head : *Item | Name and complex type |
name [0..1] : String | Name, multiplicity and type |
origin : Point = {0,0} | Name, type and initial value |
id : Integer {frozen} | Name and property |
Vishnu Institute of technology – Website: www.vishnu.edu.in
Operations (cont…)
[direction] name :type [=initial value]
Direction may be any one of the following:
in | An input parameter, may not be modified |
out | An output parameter, may be modified |
inout | An input parameter, may be modified |
Vishnu Institute of technology – Website: www.vishnu.edu.in
Operations (cont…)
isQuery | Execution of the operation does not change the state of the system. |
sequential | Denotes that the operation is suitable for sequential access only. |
guarded | Indicates that the operation guarantees integrity in case of concurrent access. Concurrent calls will be performed in a sequential manner. |
concurrent | Denotes that the operation can be called concurrently and the integrity of the object will be preserved. Operation executes on the object concurrently. |
Vishnu Institute of technology – Website: www.vishnu.edu.in
Advanced Relationships
Vishnu Institute of technology – Website: www.vishnu.edu.in
Advanced Relationships
Vishnu Institute of technology – Website: www.vishnu.edu.in
Dependency
Source
Target
Vishnu Institute of technology – Website: www.vishnu.edu.in
Dependency (cont…)
bind | Specifies that the source instantiates (creates object) the target template using the given actual parameters |
derive | Specifies that the source may be computed from the target |
friend | Specifies that the source is accessible by the target regardless of the visibility of the source element |
instanceOf | Specifies that the source object is an instance of the target classifier |
instantiate | Specifies that the source creates instances of the target |
powertype | Specifies that the target is a powertype of the source. A powertype is a classifier whose objects are the children of a given parent. |
refine | Specifies that the target is at a lower level of abstraction than the source |
use | Specifies that the source element depends on the target for its functionality. |
Vishnu Institute of technology – Website: www.vishnu.edu.in
Dependency (cont…)
Examples:
<<bind>>
TList
T
DoubleList
IntegerList
<<bind>>
<<bind>>
<<derive>>
Grade
class
Evaluate
calSum()
calAvg()
calGrade() : Grade
<<derive>>
Vishnu Institute of technology – Website: www.vishnu.edu.in
Dependency (cont…)
<<friend>>
Graphics
- drawString()
- drawOval()
DrawObject
create()
delete()
<<friend>>
<<instanceOf>>
manoj : Student
Student
<<instanceOf>>
<<instantiate>>
HTML Editor
HTML Page
<<instantiate>>
Vishnu Institute of technology – Website: www.vishnu.edu.in
Dependency (cont…)
<<powertype>>
Car
Vehicle
<<powertype>>
<<refine>>
Order
<<refine>>
Order
dateOfOrder
amount
shippmentDate
recordShippment()
<<use>>
Order
<<use>>
OrderItem
Vishnu Institute of technology – Website: www.vishnu.edu.in
Dependency (cont…)
Examples:
access | Specifies that the source package has the right to access the elements of the target package |
import | Specifies that the public elements of the target package enter the namespace of the source package as if they were declared in the source. |
UI
Graphics
<<access>>
UI
Graphics
<<import>>
Vishnu Institute of technology – Website: www.vishnu.edu.in
Dependency (cont…)
extend | Specifies that the target use case extends the functionality of the source use case |
include | Specifies that the source use case incorporates the behavior of the target use case to function as a whole. |
Examples:
Login
Change Password
<<extend>>
Withdraw Money
Card Validation
<<include>>
Vishnu Institute of technology – Website: www.vishnu.edu.in
Dependency (cont…)
become | Specifies that the source object becomes the target object at some point in time |
call | Specifies that an operation in source calls another operation of the target |
copy | Specifies that the target is an exact, but independent copy of the source |
Vishnu Institute of technology – Website: www.vishnu.edu.in
Dependency (cont…)
Examples:
e1 : Employee
role = employee
e1 : Employee
role = manager
<<become>>
s1: Student
ev : Evaluator
<<call>>
c1: Car
c2 : Car
<<copy>>
Vishnu Institute of technology – Website: www.vishnu.edu.in
Dependency (cont…)
send | Specifies that the source, an operation whose target is a signal, sends the target signal |
trace | Specifies that the source element has a conceptual connection to the target which individually belong to different models |
Student
S1 : Student
<<trace>>
Vishnu Institute of technology – Website: www.vishnu.edu.in
Generalization
Vishnu Institute of technology – Website: www.vishnu.edu.in
Generalization (cont…)
implementation | Specifies that the child inherits the implementation of the parent but does not support its interfaces, there by violating the principle of substitutability. |
Vishnu Institute of technology – Website: www.vishnu.edu.in
Generalization (cont…)
complete | Specifies that no additional children are permitted |
incomplete | Specifies that additional children are permitted |
disjoint | Specifies that the objects of the parent may not have more than one of the children as a type |
overlapping | Specifies that the objects of the parent may have more than one of the children as a type. |
Vishnu Institute of technology – Website: www.vishnu.edu.in
Association
Vishnu Institute of technology – Website: www.vishnu.edu.in
Association - Navigation
Vishnu Institute of technology – Website: www.vishnu.edu.in
Association - Navigation
Order
Products
contains
Vishnu Institute of technology – Website: www.vishnu.edu.in
Association - Visibility
Vishnu Institute of technology – Website: www.vishnu.edu.in
Association - Visibility
UserGroup
User
Password
+user
+owner
-key
Vishnu Institute of technology – Website: www.vishnu.edu.in
Association - Qualification
Vishnu Institute of technology – Website: www.vishnu.edu.in
Association - Qualification
Bank
Person
accountNumber : int
account holder
1
1..*
Vishnu Institute of technology – Website: www.vishnu.edu.in
Association – Association Class
Vishnu Institute of technology – Website: www.vishnu.edu.in
Association – Association Class
Person
Company
1..*
*
employer
employee
Job
description
dateHired
salary
Vishnu Institute of technology – Website: www.vishnu.edu.in
Association - Composition
Vishnu Institute of technology – Website: www.vishnu.edu.in
Association - Composition
Department
College
part of
Vishnu Institute of technology – Website: www.vishnu.edu.in
Association (cont…)
implicit | Specifies that the relationship is not physical, but rather conceptual |
ordered | Specifies that the objects at one end of the association are in a certain order |
changeable | Links between objects can be added, removed |
addOnly | New links may be added from an object on the opposite side of the association |
frozen | After adding a link it might not be modified later |
xor | Indicates that among a set of associations, only one can be applied for each object |
Vishnu Institute of technology – Website: www.vishnu.edu.in
Realization
Vishnu Institute of technology – Website: www.vishnu.edu.in
Realization – Examples
HTMLParser
Parser
<<interface>>
scan()
parse()
Htmlparser.dll
Parser
Validate
User
Validation
Vishnu Institute of technology – Website: www.vishnu.edu.in
CRC (Class-Responsibility-Collaborator) Cards
Introduced by Beck & Cunningham (1989)
Online Shopping System
Vishnu Institute of technology – Website: www.vishnu.edu.in
Class Diagram
Vishnu Institute of technology – Website: www.vishnu.edu.in
Class diagram
Vishnu Institute of technology – Website: www.vishnu.edu.in
Class diagram – Common Uses
Vishnu Institute of technology – Website: www.vishnu.edu.in
Class diagram - Example
Vishnu Institute of technology – Website: www.vishnu.edu.in
Object Diagram
Vishnu Institute of technology – Website: www.vishnu.edu.in
Object diagram
Vishnu Institute of technology – Website: www.vishnu.edu.in
Object diagram – Example
Vishnu Institute of technology – Website: www.vishnu.edu.in
Class and Object Diagrams
Vishnu Institute of technology – Website: www.vishnu.edu.in
Behavioral Modeling
Vishnu Institute of technology – Website: www.vishnu.edu.in
Behavioral Modeling
Vishnu Institute of technology – Website: www.vishnu.edu.in
Use Case Diagram
Vishnu Institute of technology – Website: www.vishnu.edu.in
Use Cases
Vishnu Institute of technology – Website: www.vishnu.edu.in
Use Cases (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Use Cases (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Use Cases – Example
Order product
Validate user
Library :: Make Reservation
Simple Names
Path Name
Vishnu Institute of technology – Website: www.vishnu.edu.in
Describing Use Cases
Vishnu Institute of technology – Website: www.vishnu.edu.in
Actors
Vishnu Institute of technology – Website: www.vishnu.edu.in
Actors (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Organizing Use Cases
Vishnu Institute of technology – Website: www.vishnu.edu.in
Organizing Use Cases - Packages
College Information System
Vishnu Institute of technology – Website: www.vishnu.edu.in
Organizing Use Cases - Packages
Use cases in the library package
Vishnu Institute of technology – Website: www.vishnu.edu.in
Organizing Use Cases - Generalization
Vishnu Institute of technology – Website: www.vishnu.edu.in
Organizing Use Cases (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Use Case Diagrams
Vishnu Institute of technology – Website: www.vishnu.edu.in
Use Case Diagram – Example
Vishnu Institute of technology – Website: www.vishnu.edu.in
Use Case Diagram – Example
Vishnu Institute of technology – Website: www.vishnu.edu.in
Interaction Diagrams
Vishnu Institute of technology – Website: www.vishnu.edu.in
Interactions
Vishnu Institute of technology – Website: www.vishnu.edu.in
Interactions - Example
u : User
v : Validator
sendDetails(u,p)
object
object
Link
message
Vishnu Institute of technology – Website: www.vishnu.edu.in
Interactions (cont…)
association | Specifies that the corresponding object is visible by association |
Self | Specifies that the corresponding object is visible as it is the dispatcher of the operation |
Global | Specifies that the corresponding object is visible as it is in an enclosing scope |
Local | Specifies that the corresponding object is visible as it is in local scope |
parameter | Specifies that the corresponding object is visible as it is a parameter |
Vishnu Institute of technology – Website: www.vishnu.edu.in
Interactions - Example
Person
+setSalary(s : String)
+assign(d : Department)
Company
employee
employer
1..*
1
p : Person
: Company
assign(development)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Interactions (cont…)
Call | Invokes an operation on an object |
Return | Returns a value to the caller |
Send | Sends a signal to the object |
Create | Creates an object |
Destroy | Destroys an object |
Vishnu Institute of technology – Website: www.vishnu.edu.in
Interactions - Example
Vishnu Institute of technology – Website: www.vishnu.edu.in
Interactions – Sequencing
Vishnu Institute of technology – Website: www.vishnu.edu.in
Interactions – Sequencing (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Interactions – Sequencing (cont…)
: View
c : Controller
: Cache
2 : clickAt(p)
2.1 : I = findAt(p)
2.2 : putRecentPick(I)
c : Caller
: Telephone
: Exchange
1 : liftHandset()
2 : assertCall()
Vishnu Institute of technology – Website: www.vishnu.edu.in
Interaction diagrams
Vishnu Institute of technology – Website: www.vishnu.edu.in
Sequence Diagrams
Vishnu Institute of technology – Website: www.vishnu.edu.in
Sequence Diagrams (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Sequence Diagrams (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Collaboration Diagrams
Vishnu Institute of technology – Website: www.vishnu.edu.in
Collaboration Diagrams (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Collaboration Diagrams (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Activity Diagrams
Vishnu Institute of technology – Website: www.vishnu.edu.in
Activity Diagrams
Vishnu Institute of technology – Website: www.vishnu.edu.in
Activity Diagrams (cont…)
Enter User Details
result := getAvg() + 20;
Simple action
expression
Vishnu Institute of technology – Website: www.vishnu.edu.in
Activity Diagrams (cont…)
Make Payment
entry / Select Product
Vishnu Institute of technology – Website: www.vishnu.edu.in
Activity Diagrams - Transitions
Make Payment
Select Product
Start state
Stop state
Vishnu Institute of technology – Website: www.vishnu.edu.in
Activity Diagrams - Branching
Vishnu Institute of technology – Website: www.vishnu.edu.in
Activity Diagrams - Branching
Vishnu Institute of technology – Website: www.vishnu.edu.in
Activity Diagrams – Fork and Join
Vishnu Institute of technology – Website: www.vishnu.edu.in
Activity Diagrams – Fork and Join
Vishnu Institute of technology – Website: www.vishnu.edu.in
Activity Diagrams – Fork and Join
Fork
Join
Vishnu Institute of technology – Website: www.vishnu.edu.in
Activity Diagrams – Swimlanes
Vishnu Institute of technology – Website: www.vishnu.edu.in
Activity Diagrams – Swimlanes
Vishnu Institute of technology – Website: www.vishnu.edu.in
Activity Diagrams – Swimlanes
Vishnu Institute of technology – Website: www.vishnu.edu.in
Events and Signals
Vishnu Institute of technology – Website: www.vishnu.edu.in
Events and Signals
Vishnu Institute of technology – Website: www.vishnu.edu.in
Events and Signals (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Events and Signals (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Events and Signals (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Events and Signals (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Events and Signals (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Events and Signals (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Events and Signals (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
State Machine
Vishnu Institute of technology – Website: www.vishnu.edu.in
State Machines
Vishnu Institute of technology – Website: www.vishnu.edu.in
State Machines (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
State Machines (cont…)
Name | A textual string which distinguishes one state from other states |
Entry/exit actions | Actions executed on entering and exiting the state |
Internal transitions | Transitions that are handled without causing a change in state |
Substates | The nested structure of a state, involving disjoint or concurrent substates |
Deferred events | A list of events that are not handled in that state, but are postponed or queued for handling by the object in another state |
Vishnu Institute of technology – Website: www.vishnu.edu.in
State Machines (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
State Machines (cont…)
Source state | The state affected by the transition |
Event trigger | The event whose reception changes the state of the object |
Guard condition | A boolean expression which is evaluated when the transition is triggered |
Action | An executable atomic computation that is performed on or by an object |
Target state | The state that is active after the completion of the transition |
Vishnu Institute of technology – Website: www.vishnu.edu.in
State Machines (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
State Machines (cont…)
Advanced States
Vishnu Institute of technology – Website: www.vishnu.edu.in
State Machines – Substates
Vishnu Institute of technology – Website: www.vishnu.edu.in
State Machines – Substates (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
State Machines – Substates (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
State Machines – Substates (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
State Machines – Substates (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
State Machines – Substates (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
State Chart Diagrams
Vishnu Institute of technology – Website: www.vishnu.edu.in
State Chart Diagrams (cont…)
State machine for an ATM
Vishnu Institute of technology – Website: www.vishnu.edu.in
Architectural Modeling
Vishnu Institute of technology – Website: www.vishnu.edu.in
Components
Vishnu Institute of technology – Website: www.vishnu.edu.in
Components
Vishnu Institute of technology – Website: www.vishnu.edu.in
Components (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Components (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Components (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Components (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Components (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Components (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Components (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Components (cont…)
executable | Specifies a component that may be executed on a node |
library | Specifies a static or dynamic object library |
table | Specifies a component that represents a database table |
file | Specifies a component that represents a document containing code or data |
document | Specifies a component that represents a document |
Vishnu Institute of technology – Website: www.vishnu.edu.in
Components (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Component Diagram
Vishnu Institute of technology – Website: www.vishnu.edu.in
Component Diagram - Example
Vishnu Institute of technology – Website: www.vishnu.edu.in
Deployment
Vishnu Institute of technology – Website: www.vishnu.edu.in
Deployment
Vishnu Institute of technology – Website: www.vishnu.edu.in
Deployment (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Deployment (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Deployment (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Deployment (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Deployment (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Deployment Diagrams
Vishnu Institute of technology – Website: www.vishnu.edu.in
Deployment Diagrams (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Deployment Diagrams (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Deployment Diagrams (cont…)
Vishnu Institute of technology – Website: www.vishnu.edu.in
Forward Engineering
Vishnu Institute of technology – Website: www.vishnu.edu.in
CASE STUDY�Vending Machine
Vishnu Institute of technology – Website: www.vishnu.edu.in
Vending Machine
Vishnu Institute of technology – Website: www.vishnu.edu.in