What Is UML?
What Is UML?
Systems software
Business processes
Public Feedback
UML1.1
UML0.9
Unified Method 0.8
Other method
Booch
OMT
OOSE
3
Advantages of UML:
Captures business processes
Enhance communication and ensures the right communication
Capability to capture the logical software architecture independent of
What is a tool?
It is automated support for every stage of software development
life cycle.
Since we are concentrating on requirement, analysis and design phase,
following are the names of few tools which are greatly in use:
1. Rational Rose
2. Cayenne
3. Platinum
4. Select
Why Tool?
Helps designer for creating designs much more quickly.
Supports validations like:
Consistency checking
Completeness checking
Constrain checking.
Time required for certain operation could be predicted .
Code generation
Reverse engineering.
Round trip engineering
Conversion from SSAD to OOAD
Quick documentationetc
8
of the project.
Notation
Tool
Method
OO model:
DYNAMIC MODEL
STATIC MODEL
LOGICAL MODEL
PHYSICAL MODEL
10
UML diagrams:
1. Use case diagram
2. Class Diagram
3. Behavioral diagrams
- State chart diagrams
- Object diagram
- Activity diagrams
- Interaction diagrams
- Sequence diagrams
- Collaboration diagrams
4. Implementation diagrams
- Component diagram
- Deployment diagram
12
Semantics of Diagrams:
Use case diagrams represent the functions of a system from the users
point of view.
Sequence diagrams are a temporal representation of objects and their
interactions.
Collaboration diagrams are a spatial representation of objects, links,
and interactions.
Object diagrams represent objects and their relationships, and
correspond to simplified collaboration diagrams that do not represent
message broadcasts.
Class diagrams represent the static structure in terms of classes and
relationships.
13
Semantics of Diagrams:
Contd...
State chart diagrams represent the behavior of a class in terms of states
Activity diagrams are to represent the parallel behavior of an operation
as a set of actions.
Component diagrams represent the logical components of an
application.
Deployment diagrams represent the deployment of components on
particular pieces of hardware.
14
Actor
Use case
System boundary
Relationship
Actor relationship
15
ACTOR:
What is an actor?
An actor is some one or something that must interact with the system
under development
UML notation for actor is stickman, shown below.
Customer
Manager
Cashier
16
ACTOR:
More about an actor:
It is role a user plays with respect to system.
Actors are not part of the system they represent anyone or
17
ACTOR:
An actor may
18
ACTOR:
How do we find the actor?
Ask following questions to find the actors:
system to be developed.
19
ACTOR:
4-Categories of an actor:
Principle
Secondary
20
ACTOR:
Note:
If newly identified actor is using a system in a same way like an
21
USE CASE:
Withdrawal of cash
from ATM
22
USE CASE:
More about USE CASE:
It is a snapshot of one aspect of system.
They model a dialog between actor and system.
A use case typically represents a major piece of functionality
23
USE CASE:
Contd
A use case must deliver something of value to an actor.
The use cases may be decomposed into other use cases.
Use cases also present a good vehicle for project planning.
24
USE CASE:
How do we find the use cases?
What functions will the actor want from the system?
Does the system store information? What actors will create, read,
25
USE CASE:
Generic format for documenting the use case:
- Pre condition:
If any
Use case
:
Name of the case.
Actors :
List of actors(external agents), indicating who
initiates the use case.
Purpose :
Intention of the use case.
Overview
:
Description.
Type
:
primary / secondary.
Post condition: If any
Typical Course of Events:
ACTOR ACTION : Numbered actions of the actor.
SYSTEM RESPONSE : Numbered description of system responses.
26
USE CASE:
USE CASE documentation example:
The following use case describes the process of opening a new
account in the bank.
Use case :Open new account
Actors
:Customer, Cashier, Manager
Purpose
:Like to have new saving account.
Description :A customer arrives in the bank to open the new
account. Customer requests for the new account
form, fill the same and submits, along with the
minimal deposit. At the end of complete successful
process customer receives the passbook.
Type
Design &
Implementation
Test
Capture,clarify
& validate use cases
Implement
use cases
28
SYSTEM BOUNDARY:
What is System Boundary?
It is shown as a rectangle.
It helps to identify what is external verses internal, and what the
29
RELATIONSHIP:
What is Relationship?
Relationship between use case and actor.
Communicates
Relationship between two use cases
Extends
Uses
Notation used to show the relationships:
<<
>>
30
RELATIONSHIP:
Relationship between use case and actor is often referred as
communicates .
Relationship between two use cases is refereed as either uses
or extends.
USES:
- Multiple use cases share a piece of same functionality.
- This functionality is placed in a separate use case rather than
documenting in every use case that needs it.
31
RELATIONSHIP:
Contd...
A uses relationship shows behavior that is common to one or
more use cases.
EXTENDS:
It is used to show optional behavior, which is required only
under certain condition.
32
Balance status
report
extends
Clerk
Withdraw cash
Customer
uses
Validation
Manager
ATM
33
Flow of Events:
A flow of events document is created for each use case.
Details about what the system must provide to the actor when the use
is executed.
Typical contents
How the use case starts and ends
Normal flow of events
Alternate flow of events
Exceptional flow of events
34
35
Contd...
9.The ATM asks for the amount of cash; user enters Rs. 2500/10.The ATM verifies that the amount of cash is within predefined
policy limits and asks the bank, to process the transaction which
eventually confirms success and returns the new account balance.
11. The ATM dispenses cash and asks the user to take it.
12. The user takes the cash.
13. The ATM asks whether the user wants to continue.
14. The user indicates no.
36
37
38
39
design.
40
What is Scenario?
The functionality of the use case is captured in flow of the
events.
A scenarios is one path through the flow of events for the use
case.
Scenarios are developed to help identify objects, classes and
object interactions for that use case.
41
42
43
scenario.
Shows object interaction arranged in time sequence.
They show sequence of messages among the objects.
It has two dimensions, vertical represents time & horizontal
represents objects.
Components of sequence diagram:
-objects
-object lifeline
-Message
-pre/post conditions.
44
45
MESSAGES:
They are used to model the content of communication between
message.
46
MESSAGES:
Contd
May have square brackets containing a guard conditions. This is a
Boolean condition that must be satisfied to enable the message to be
sent.
May have have an asterisk followed by square brackets containing an
iteration specification. This specifies the number of times the message
is sent.
May have return list consisting of a comma -separated list of names
that designate the values of returned by the operation.
Must have a name or identifier string that represents the message.
May have parentheses containing an argument list consisting of a
comma separated list of actual parameters passed to a method.
47
Sequence diagram
:Customer
Insert card
Request password
Enter the password
Request option
Enter option
Request amount
Enter the amount
Dispense cash
Request take cash
:ATM
:Bank
Verify account
Account o.k.
Create
Transaction
:Transaction
Update transaction
Transaction commit
Transaction
complete
Take cash
Request continuation
Terminate
Print receipt ,eject card
Request take card
Take card
Display main screen and prompt for the card.
48
49
50
Semantics of components:
Object names identify which objects are participating and the links
51
Iteration expression
Parameters
Return values
Guard
Message stereotypes
Simple
message
Nested
message
Nested
message with
return value
Conditional
message
Synchro. with
other flow of
execution
Iteration
Parallel
iteration
53
CUSTOMER
Create Transaction
Transaction complete
TRANSACTION
ATM
Transaction succeed
Transaction failed
account o.k.
bad account,
bad password,
bad bank code
BANK
54
55
RELATIONSHIP:
Association
Aggregation
Composition
Inheritance
Dependency
Instantiation
57
ASSOCIATION:
CUSTOMER
ATM system
58
AGGREGATION:
59
AGGREGATION:
Example:
Customer
ATM card
60
COMPOSITION:
Window
Client Area
61
INHERITANCE:
The inheritance relationship helps in managing the complexity by
CurrentAccount
SavingAccount
62
DEPENDENCY:
Dependency is semantic connection between dependent and
Client
Server
63
INSTANTIATION
This relationship is defined between parameterized class and
actual class.
Parameterized class is also referred as generic class.
A parameterized class cant have instances unless we first
instantiated it
Example:
Element
Queue
Queue<int>
64
What is Cardinality? :
relationship.
65
66
Customer
1
1..*
1..*
0..*
Transaction
1..*
ATMSystem
1
1
1
Bank[Branch]
67
Group classes
into domains
Identify class
behavior
Identify Messages
Group Objects
into classes
Identify & classify
Class relationships
69
Refinement attributes:
Stereotypes:
Stereotypes are part of the range of extensibility mechanism provided
by UML
It permits user to add new model element classes on top of the kernel
predefined by UML
70
Refinement attributes:
Contd
Constraints:
Constraints are functional relationship between the entities and object
model. The entities include objects, classes, attributes, association,
links.
A constraint restricts the values that entities can assume.
UML doesn't specify a particular syntax for constraints, other than
they should appear between braces, so they may therefore be
expressed using natural language, pseudo code, navigation expression
or mathematical expression
UML1.2 does prefer the use of a constraint language OCL i.e. Object
Constraint Language, which is subset of UML.
71
Refinement attributes:
Example:Constraints
Number of withdrawal transaction should be less than five per day.
Transaction
Window
length/width
Refinement attributes:
Qualifier:
UML provides a role of constraint notation to indicate different kind of
collections that may be inherent in the analysis model
Common role constraints for multi valued roles include
{ordered}
Collection is maintained in sorted manner
{bag}
Collection may have multiple copies of same item.
{set}
Collection may have at most one copy of given item.
Some constraints may be combined such as: {ordered set}
73
Refinement attributes:
Qualifier:
Another common design scheme is to use a key value to retrieve an
item from the collection. This is called as qualified association and the
key value as qualifier.
A qualified association is the UML equivalent of a programming
concept variously known as associative arrays, maps,dictionaries
A qualified association relates two object classes and a qualifier
The qualifier is a special attribute that reduced the effective
multiplicity of an association.
One to many and many to many association may be qualified.
74
Refinement attributes:
Check for many to many relationship, if any, normalize with qualifier
or association class.
Check for the scope forming abstract classes and template classes.
Check for helper functions.
Thought can be given for using the design patterns.
75
ATMSystem
1..*
1
Bank[Branch]
Cash
BankComputer
BatchJob
<<abstract>>
AccountAccessor
<<abstract>>
person
Transaction
1..*
Slips
CashierStation
1
Customer BankAssociates
1..*
<<abstract>>
Account
1
CurrentAccount SavingAccount
0..1
BankCard
ATMScreen
TellerScreen
NoteHelpForBankCard
76
events or the messages that cause a transition from one state to another
and the action that result from a state change.
A state transition diagram will not be created for every class in the
system.
Components of State Diagram:
Start State
Stop state
State Transition
77
Start state: Each state diagram must have one and only one start
state. Notation for start state is filled solid circle.
Stop State: An object can have multiple stop states. Notation for stop
state is bulls eye.
78
79
request and fill the form for new saving account[ validate ] / process
Open
transaction request[ validate ] / update()
transactionStrart / Transfer_to_main_ledger ()
Dormant
Operational
no transaction / Transfer_to_Dormant_Ledger
fill_the_request_form/update(
Fraud or authorized instruction[Validate]
)
/ lockAccount()
matter_resolved[ validate ] / unlockAccount()
close
fill_the_request_form / update()
seized
80
behavior.
State diagrams are also useful to investigate the behavior of user
interface and control classes.
State diagram are used to show dynamics of a individual class
81
It is a special kind of state diagram and is worked out at use case level.
These are mainly targeted towards representing internal behavior of a
a use case.
These may be thought as a kind of flowchart.
Flowcharts are normally limited to sequential process; activity
diagrams can handle parallel process.
Activity diagrams are recommended in the following situations:
i
Analyzing use case
i
Dealing with multithreaded application
i
Understanding workflow across many use cases.
82
Consistency Checking
83
84
Component Diagram
policy.dll
Bank
Server.exe
Branch
Bank.dll
customer.dll
Branch
Bank.exe
ATM.exe
85
86
Deployment diagram
Branch
Bank_
Bank.exe
Ethernet
ATM_
machine
ATM.exe
Ethernet
Bank_
server
BankServer.exe
87