Introduction To UML: U M L L Language
Introduction To UML: U M L L Language
L (A ,R ) C o m m u n ic a t io n
la n g u a g e a lp h a b e ts g ra m m a r
– Visualizing
– Specifying
– Constructing
– Documenting
– Things
• Things are abstractions in a model
– Relationships
• Relationships tie the things together
– Diagrams
• Diagrams group relevant collection of things
Basic Building Blocks: Things
• There are four kinds of things in the UML
1. Structural things
2. Behavioral things
3. Grouping things
4. Annotational things
Structural Things in UML
• Relevant things that are either conceptual or physical
Examples: class, object, etc.
N am e
A t t r ib u t e s
O p e r a t io n s
Structural Things: Active Class
•Active Class
– An active class is just like a class
expect that its object represent
element whose behavior is
concurrent with other elements E vent M anger
A t t r ib u te s
– An object of an active class owns one
or more processes or threads and re s u m e ()
therefore initiate control activity s ta rt()
s u s p e n d ()
k ill( )
– Graphically, an active class is f lu s h ( )
denoted just like a class, but with a
heavy line, usually including its
name, attributes, and operations
Structural Things: Component
• Component
– Component of a system is to
conform with the realization of a set
of interfaces
m y P a c k a g e .h tm
– Example: An applet, com+
component, Java bean or ASP file.
In fact, a component is typically
represents a physical package of
otherwise logical elements such as
classes, interfaces and collaborations
–
iS y n o n
C om ponent
Graphically, an interface rendered as
iC o u n t
ym s
Example:
W o r ld T r a d e C e n te r
A big building (world trade center) is a
collaboration of some structural
construction, electrical wiring system,
telephone connectivity, internet
connectivity, water supply system, etc.
a s s ig n ( t e s tin g )
e : P e rs o n c : Com pany
Behavioral Things: State Machine
• State machine
– Using an interaction one can model the behavior of
a society of objects that work together
w a it r u n n in g
k e y p re s s
A s ta te m a c h in e fo r a n o b je c t
B u tto n
G r a p h ic s
Annotational Things in UML
• Annotational things are the explanation parts of UML
models
S im p le T e x t
U R L + T ext
IS D IT 6 0 1 0 5 # 2 0
C o m m e n ts
w it h im a g e s
Relationships in UML
• A relationship is a concern among things
V id e o C lip
p la y ( c : C lip )
s ta rt() I n d e p e n d e n t c la s s
s to p ()
r e s iz e ( )
re s e t()]
: H e re , if th e re is a c h a n g e in th e
c la s s C lip , th e o p e ra tio n p la y () in
D e p e n d e n t c la s s th e c la s s V id e o w ill b e e ffe c te d
Relationships: Association
• Association
1 ..* W o rk s fo r
P e rs o n * C om pany
e m p lo y e e e m p lo y e r
A s s o c ia tio n
1 Has
U n iv e r s ity * D e p a rtm e n t
A g g r e g a tio n
Relationships: Generalization
• Generalization
– A generalization is a generalized/specialized relationship in
which objects of the specialized elements (the child), are
suitable for objects of the generalized elements (the parent)
P a re n t
C h ild
Relationships: Realization
• Realization
– A realization is a semantic connection
• between two things: interface, class, component
• between use-case and collaboration
etc.
IE E E M e m b e r S tu d e n t
: :
b io d a ta ( ) b io d a ta ( )
: :
Diagrams in UML
• Any system can be viewed with five interrelated views
S tr u c tu r a l v ie w B e h a v io r a l v ie w
U s e r 's v ie w
Im p le m e n ta tio n v ie w E n v ir o n m e n ta l v ie w
Diagrams in UML
• To represent each view, UML provides nine diagrams,
popularly termed as UML diagrams or UML artifacts
S tru c tu ra l v ie w B e h a v io ra l v ie w
C la s s d a ig r a m s A c t iv it y d a ig r a m s
O b je c t d ia g r a m s I n t e r a c t io n o v e r v ie w d ia g r a m s
P a c k a g e d ia g r a m s S e q u e n c e d ia g r a m s
C o m p o s it e s t r u c t u r e d ia g r a m s C o lla b o r a t io n d ia g r a m s
S t a t e c h a r t d ia g r a m s
T im in g d ia g r a m s
U s e r 's v i e w
U s e c a s e d a ig r a m s
Im p le m e n ta tio n v ie w E n v iro n m e n ta l v ie w
C o m p o n e n t d a ig r a m s D e p lo y m e n t d a ig r a m s
What is a Use Case Diagram?
• The use case diagram is a diagram to model the use case view
of a system. The behavior of the system under development
(i.e. what functionality must be provided by the system) is
documented in a use case diagram
• Example:
– On-line purchase (OLP) system
On-Line Purchase (OLP) System
• Intended functions • Its surroundings
– Search items – Customer
– Place order – Manager
– Process order – Payment processor
– Control inventory
– Help on-line
Use Case Diagram of OLP System
S e a rc h ite m s
P la c e o rd e r
C u s to m e r
< < S y s te m > >
P ro c e ss o rd e r
P a y m e n t p ro c e s s o r
In v e n to ry c o n tro l
O n -lin e h e lp M anager
Usage of Use Case Diagrams
1. Use case diagram depicts the
desirable functionalities (dynamic
aspects) of an information system
S e a rc h ite m s
decomposition) of a system
In v e n to ry c o n tro l
• Formal definition
• A use case is a sequence of transactions performed by the system
that yields a measurable result of values for a particular user (actor)
P la c e o rd e r
Actor in Use Case Diagram
• Actor
– An actor is a person, organization, or external system that plays a role
in one or more interaction with the system
• Note: Actors are not part of the system; they represent any one or any thing
that interact with the system
Notation
P la c e o rd e r
In v e n to ry c o n tro l
Notation R e le a s e 2
M anager
T a x c a lc u la tio n
R e le a s e 3
O n -lin e h e lp
R e le a s e 4
Packages in Use Case Diagram
• Packages
– Packages enable to organize model elements into groups
Notation
Packages are depicted as a file folders and can be used on any
of the UML diagrams, including both use case diagrams, class
diagrams etc.
R e g is tr a tio n
Note: Usually package can be used when a UML diagram is quite large and
can not be accommodated on a single page, or organize a large diagram
into smaller ones
Packages in Use Case Diagram
• Example
S tu d e n t R e g is tr a t io n
S y s te m
C o u rs e
R e g is tr a t io n B illin g
a llo t m e n t
Scenario and Use Case
• Scenario
– A scenario is a sequence of steps describing an
interaction between a user and system
Note: From one scenario, another scenario can arise. For example: at 3 incomplete
information, at 6 authorization fails etc.
How to Create a Use Case Diagram?
• Three steps
1. Identify all actors
2. Identify all use cases
3. All associations between actors and use cases
….. etc.
Identifying all Use Cases
• The following questions may be used to help identify the actors for a
system
– What are the functional requirements?
– Will any actor create, change, store, remove, or read information in the
system?
….etc.
Identifying all Associations
• There will be an association between an actor and a use
case, if there is
– information storing/updating
….etc.
Use Case Relationships
• In addition to association relationship ( which may exist
between an actor and use-case) to represents a communication
between an actor and a use-case, there are other three types of
relationships may exist between use-cases
– Include
– Extend
– Generalization
Include Relationship
• A use case in UML is same as the function in
structured design
– Include
• To represent that a use case is composed of (reuse)
Include Relationship
• Further
– Multiple use cases may share a piece of some
common functionality. This functionality is placed
in a separate use case rather than documenting it in
every use case that needs it
e>> S e a rc h B o o k
clud
<<in
Is s u e B o o k
U p d a te B o o k
Extend Relationship
– The extended relationship is used to describe a variation on
normal behavior and one wish to use the more controlled
form. Usually extended relationship is considered to depict
the following situations
• Optional behavior
B illin g <<ex
tend> > C heque paym ent
>
c lu de>
<<in
O th e r p a y m e n ts <<in
c lude
>>
C r e d it c a r d p a y m e n t
Example: Extend Relationship
G e t R e g is tr a t io n
S e c u r it y C h e c k
P ro c e s s O rd e r
I f a s t u d e n t is
w ith f o r ie g n v is a
< < e x te n d > > < < e x te n d > >
C r e d it C a r d V a lid a t io n P a y R e b a te
If th e c u s to m e r
T o a s p e c ia l t y p e
is n o t a r e g u la r
o f c u s to m e r
c u s to m e r
Generalization Relationship
• Generalization relationship is very similar to the inheritance
relationship as in classes
Pay Fees
C r e d it C a r d D e m a n d D ra ft e B a n k in g
Generalization Relationship
• The generalization relationship can also be extended to actor
S tu d e n t
S tu d e n t
In t e r n a tio n
s tu d e n t
UG PG R e s e ra c h
Use Case Packaging
• Packaging is the mechanism in UML to manage complexity
• When there are too many use cases in the use case diagram, it
is better to package the related use cases so that it can be better
documented
Example: Use Case Packaging
U se case 1 U se case 2
U se case 3
U s e c a s e 3 .1 U s e c a s e 3 .2
U s e c a s e 3 .3
U s e c a s e 3 .3 .1 U s e c a s e 3 .3 .2
U s e c a s e 3 .3 .3
What is a Class Diagram?
• A class is a structural component of any object oriented system. The class
diagram used to model the structural view of the underlying system
• Class diagrams also show the attributes and operations of a class. Also it
can depict the navigability (direction of trace ability) and the constraints
that apply to the way objects are connected
Detail Class Diagram
• Class diagram also shows the attributes and operations of classes
B ook
Nam e
b o o k N a m e : S t r in g
Attributes
A u t h o r s : S t r in g
A ttr ib u te s A c c n N o :S t r in g
d a te O fIs u u e : D a te
is s u e T o :P e r s o n
d a te O fR e tu rn : D a te
Operations
O p e r a tio n s
is s u e ( b o r r o w e r I d : P e r s o n I D )
r e t u r n ( ) :flo a t
r e s e r v e ( b o r r o w e r I D :P e r s o n ,p r io r it y : in t )
e d it B o o k ( )
rem o v eB o o k ()
• Think: For the class Server, what are the attributes? operations?
Visibility
• The notation that precedes the attribute or operation name indicates the
visibility of the element, if the + symbol is used the attribute or operation has
a public level of visibility, if a - symbol is used the attribute or operation is
private. In addition the # symbol allows an operation or attribute to be defined
as protected and the ~ symbol indicates package visibility.
Relation Association
• An association implies two model elements have a relationship - usually
implemented as an instance variable in one class. This connector may include
named roles at each end, cardinality, direction and constraints. Association is the
general relationship type between elements. For more than two elements, a diagonal
representation toolbox element can be used as well. When code is generated for
class diagrams, associations become instance variables in the target class.
A s s o c ia tio n n a m e
C la s s A C la s s B
R o le A R o le B
Aggregation and Composition
A g g r e g a tio n n a m e
C la s s A C la s s B
C o m p o s itio n n a m e
C la s s A C la s s B
Association Class
A s s o c ia tio n n a m e
C la s s A C la s s B
A ssocN am e
W o rk s fo r
C la s s A C la s s B
E m p lo y e e D e p a rtm e n t
A ssocN am e
W o rk s
Multiplicity
cc
1
C la s s E x a c tly o n e
*
C la s s M a n y (z ero o r m o re }
0 ..1
C la s s O p tio n a l(z e ro o r o n e )
1 ..*
C la s s O n e o r m o re
Multiplicity & Association
Example of a Class Diagram
has
IIT D e p a rtm e n t
1 ..*
1
1 ..* 1 ..* 1 ..*
chairs
offers
works in
enrolled in
* 1 ..* 0 ..1 H O D
a tte n d s te a c h e s *
S tu d e n t C o u rs e F a c u lty
* * * 1 ..*
Another Example
Example: Internet
• ? Internet
– Network of networks (is a collection of servers)
– A collection of web pages
* lin k s 1
W eb page S erv er
*
has
1
N e tw o rk
• This class diagram shows a collection of all possible classes in the system
namely, the Internet and relationships among them
C la s s S
C la s s A C la s s B C la s s C
C la s s X C la s s Y
Another view of Internet Class Diagram
IIS A pache
* lin k s 1
W eb page S e rv e r
*
has
1
S ta tic D y a n m ic N e tw o rk
.a s p .js p .p h p LA N M A N W A N
* 1
O rd e r C u s to m e r
1
P e rso n C o rp o ra te
*
1 0 ..1
1 *
Ite m L is t P ro d u ct E m p lo y e e
What is an Object Diagram
• An object is an instance of a class
p u rc h a s e 1
O rd e r * C u s to m e r
1
P e rso n C o rp o ra te
*
0 ..1
* 1
Ite m L is t * P ro d u ct E m p lo y e e
• From the application point of views, the customer class signifies that a customer is
either a person or an organization or an employee of an organization
Example: Object Diagram
• Further consider a particular snapshot at an instance
ram: Person C u s to m e r
sita: Person
bhim: Employee
arjun: Employee P e rso n C o rp o ra te
oldIndia: Corporate [r a m , s it a ] [o ld I n d ia , n e w In d ia ]
newIndia: Corporate
E m p lo y e e
[b h im , a r ju n ]
Further assume that bhim and arjun are the employees of oldIndia
Example: Object Diagram
• The object diagram for the above snapshot will look like this
o ld In d ia : C o rp o ra te n e w In d ia : C o rp o ra te
b h im : E m p lo y e e a rju n : E m p lo y e e
s ita : P e rs o n
ra m : P e rso n
More Example: Object Diagram
• Let’s consider a small modification in the class diagram
p u rc h a s e fo r
C u s to m e r *
1
P erso n C o rp o ra te
E m p lo y e e
• This signifies that a customer being a corporate can purchase for others,
say person, organizations
More Example: Object Diagram
• A snapshot under this modified situation is
ram: Person
C u s to m e r
sita: Person
bhim: Employee
arjun: Employee 1
P e rso n C o rp o ra te
oldIndia: Corporate
[r a m , s ita ] [in d ia , o ld In d ia , n e w In d ia ]
newIndia: Corporate
india: Corporate E m p lo y e e
[b h im , a r ju n ]
O ld In d ia : C o rp o ra te N e w In d ia : C o rp o ra te
b h im : E m p lo y e e a rju n : E m p lo y e e
s ita : P e rs o n
ra m : P erso n
Interaction Diagrams
• Interaction diagrams model how groups of objects collaborate
in some behavior
– Collaboration diagrams
What is a Sequence Diagram?
• A sequence diagram shows object interactions arranged in
time sequence
• The objects participating in the interaction are shown at the top of the chart
as boxes attached to a vertical-dashed line
• Inside the box the name of the object is written with a colon separating it
form the name of the class and both the name of the class and object are
underlined
• Some times an anonymous object (only class name and underlined) is also
used
Life Line in a Sequence Diagram
• A lifeline represents an individual participant in a sequence diagram. A
lifeline will usually have a rectangle containing its object name. If its name
is self then that indicates that the lifeline represents the classifier which
owns the sequence diagram
Life Line in a Sequence Diagram
• Sometimes a sequence diagram will have a lifeline with an actor element
symbol at its head. This will usually be the case if the sequence diagram is
owned by a use case. Boundary, control and entity elements form
robustness diagrams can also own lifelines
Example: Objects and Life Line
m ih ir: S tu d e n t a u tu m n 0 6 : C o u rs e M g r : C o u rse
c la s s n a m e
a n o n y m o u s o b je c t
o b je c t n a m e
v e r t i c a l - d a s h e d l i n e s a t t a c h e d t o o b je c t s
Objects and Life Time
• The objects appearing at the top signifying that the object already existed
when the use case execution was executed.
• However, if some object is created during the execution of the use case
and participates in the interaction, then that object should be shown at the
appropriate place on the diagram where it was created
• The vertical dashed line in the sequence diagram is called the object’s life
time. The life time indicates the existence of the object at any particular
point of time
• A rectangle is used on the life time to indicate the activation symbol and
implies that the object is active as long as the rectangle exists
Example: Object’s Life Time
m ih ir: S tu d e n t
o b je c t s t a r t s a n
a c tiv ity h e r e
a n o b je c t a p p e a r s
h e re
o b je c t f i n i s h e s a n
a c tiv ity h e r e
L ife tim e
a u tu m n 0 6 : C o u rs e M g r
o b je c t e x p i r e s h e r e
Start and End of Life Line
• A lifeline may be created or destroyed during the timescale represented by
a sequence diagram. In the latter case, the lifeline is terminated by a stop
symbol, represented as a cross. In the former case, the symbol at the head
of the lifeline is shown at a lower level down the page than the symbol of
the object that caused the creation. The following diagram shows an object
being created and destroyed
Messages in Sequence Diagrams
• Two objects in a sequence diagram interacts with passing
messages between them
m ih ir: S tu d e n t a u tu m n 0 6 : C o u rs e M g r
1
r e q u e s tE n r o ll( )
2
s e a rc h ()
c o n fir m E n r o ll( )
T h r e e m e s s a g e s a re in
3 c h r o n o lg ic a l s e q u e n c e
T w o o b je c t a r e c o m m u n i c a t i n g
b y p a s s in g m e s s a g e s
More on Messages
• Messages can be synchronous or asynchronous; call or signal. In the
following diagram, the first message is a synchronous message (denoted by
the solid arrowhead) complete with an implicit return message; the second
message is asynchronous (denoted by line arrowhead) and the third is the
asynchronous return message (denoted by the dashed line)
More on Messages
• Messages can be lost or found. Lost messages are those that are either sent
but do not arrive at the intended recipient, or which go to a recipient not
shown on the current diagram. Found messages are those that arrive from
an unknown sender, or from a sender not shown on the current diagram.
They are denoted going to or coming from an endpoint element
Self or Recursive Messages
• A self message can represent a recursive call of an operation, or one
method calling another method belonging to the same object. It is shown as
creating a nested focus of control in the lifeline’s execution occurrence
Controlled Messages
m ih ir: S tu d e n t a u tu m n 0 6 : C o u rs e M g r : C o u rse
r e q u e s tE n r o ll( )
s e a rc h ()
[v a c a n t] c o n fir m E n r o ll( )
g e tC o u rs e ()
* g e tC o u rs e ()
s e n d th is m e s s a g e if th is
c o n d itio n is tr u e s e n d m e s s a g e s to a ll c o u r s e
o b je c t s
Duration and Timing Constraints
• By default, a message is shown as a horizontal line. Since the lifeline
represents the passage of time down the screen, when modeling a real-time
system, or even a time-bound business process, it can be important to
consider the length of time it takes to perform actions. By setting a
duration constraint for a message, the message will be shown as a sloping
line
ATM PIN Validation
a : c a rd R e a d e r b : s e s s io n M g r c : d is p la y M g r d : keyR eader e : aBank
c a rd In fo ()
b e g in
s e s s io n
[ ! v a lid A T M c a r d ]
e je c t ( )
ch e c k C a rd ()
sta tu s
[ s t a t u s .is S t o le n ]
r e t a in ( )
[ s t a t u s .c lo s e A c c o u n t ]
e je c t ( )
[ ! v a lid P I N & & t r y < 4 ]
re q u e stP IN ()
re a d P IN ()
v a lu e P I N
v e r ify P I N ( )
[ ! v a lid P I N ]
e je c t ( ) x x
d is p la y H e llo ( )
x x
x
Use Case Registration of OLP
Use case: Registration
b e g in s e s s io n re g n R e q u e st()
g e tC u sto m e rT y p e ()
in p u t T y p e ( )
C u sto m e rT y p e = re a d D a ta ()
[C u s to m e r T y p e = s ta ff]
g e tS ta ffD a ta ()
in p u t S t a ffD a t a ( )
c d = s ta ffC u s to m e rD a ta ()
s ta tu s 1 = c h e c k S ta ff(c d )
[ s t a t u s 1 = in v a lid ]
d is p la y M s g ( R e g n . fa il)
[ s t a t u s 1 = v a lid ]
[ s t a t u s 2 = e x is t ] s t a t u s 2 = c h e c k E x is t ( c d )
d is p la y M s g ( R e g n . f a il)
[ s t a t u s 2 = n o t E x is t ]
d is p la y M s g ( R e g n . s u c c e s s ) c 1 = c re a te C u sto m e r(c d )
u p d a te R e c o rd (c 1 )
[C u sto m e rT y p e = o th e r]
in p u t O t h e r D a t a ( ) g e tO th e rD a ta ()
c d = o th e rC u sto m e rD a ta ()
s t a t u s 2 = c h e c k E x is t ( c d )
[ s t a t u s 2 = e x is t ]
d is p la y M s g ( R e g n . f a il) [ s t a t u s 2 = n o t E x is t ]
c 2 = c re a te C u sto m e r(c d )
d is p la y M s g ( R e g n . s u c c e s s )
u p d a te R e c o rd (c 2 )
Use Case Place Order in OLP
Use case: Order Items
• The “Process Order” use case is proposed to have a following behavior (or
scenario)
• orderEntry: Window
– this object will get an order from a customer
• anOrder: Order
– receives an order from a customer (via orderEntry object)
• orderSet: ItemList
– an object is a list of items is to be processed
Sequence Diagram in OLP System
• stockist: InventoryManage
– object responsible for checking stock, supply stock, request for
inventory etc.
• :OrderInfo
– containing the orders information in a queue
• confirmMessage: Message
– message objects for sending confirmation message
• The sequence diagram for Process Order use case can be drawn as follows.
Sequence Diagram of Process Order use case
in OLP System
o rd e rE n try : C u s to m e r a n O rd e r: O rd e r o rd e rS e t: Ite m L is t s to c k is t: In v e n to ry M a n a g e r : O rd e rIn fo
c re a te () * s e tO rd e r()
s ta tu s = in v e n to r y C h e c k ()
[s ta tu s = F A L S E ]
e n q u e u e O rd e r()
a v a ila b le =
c h e c k S u p p ly ( )
[a v a ila b le = T R U E ] d e Q u e u e ()
r e p ly E s tim a te ( )
re p ly E s tim a te ( ) e s tim a te O rd e r()
a c c e p t()
c o n firm O rd e r:M e s s a g e
a c c e p t()
c o n fir m ( )
c o n firm ()
Use of Sequence Diagram
• From the sequence diagram of “Process Order” use case, it is evident that
the diagram is easy to understand and has immediate appeal. This is the
great advantage of the sequence diagram
– Messages shown as text and an arrow that points from a client object to
a respondent object
a n O rd e r:O rd e r
2 : * [fo r a ll ite m in O r d e r ]
s e tO rd e r()
3 : s ta tu s = in v e n to r y C h e c k ( )
o rd e rS e t:Ite m L is t 4 : a v a ila b le = c h e c k S u p p ly ( )
:In v e n to ry M a n a g e r
[s ta tu s ]
new [a v a ila b le ]
new
:C o n firm O rd e r :O rd e rIn fo
Note: Collaboration Diagram
• In collaboration diagram, the sequence indicated by
numbering the messages
– Focus of control
• In sequence diagram, there is the focus of control to show the
period of time during which object is performing an action. There
is no focus of control in collaboration diagram
Sequence Diagram vs. Collaboration Diagrams
• UML activity diagrams are the object oriented equivalent of flow chart and
data flow diagrams in function-oriented design approach
S y s te m
IIT
E n ro llm e n t
S tu d e n t R e g is t r a r
< < in c lu d e > >
C o u rs e re g is tra tio n
SEIIT System
• Here different activities are:
– Received enrollment form filled by the student
• Registrar checks the form
• Input data to the system
• System authenticate the environment
– Pay fees by the student
• Registrar checks the amount to be remitted and prepare a bill
• System acknowledge fee receipts and print receipt
– Hostel allotment
• Allot hostel
• Receive hostel charge
• Allot room
– Medical check up
• Create hostel record
• Conduct medical bill
• Enter record
– Issue library card
– Issue identity card
Activity Diagram for the Use Case in
SEIIT
R e c e iv e d f o r m
H o s te l
P a y m e n t fe e s M e d ic a l c h e c k
a llo t m e n t
Is s u e id e n tit y I s s u e lib r a r y
c a rd c a rd
Basic Components in an Activity Diagram
• Initial node
– The filled circle is the starting point
of the diagram
R e c e iv e d f o r m
• Final node
– The filled circle with a boarder is the
ending point. An activity diagram
can have zero or more activity final P a y m e n t f e e s H o s te l
M e d ic a l c h e c k
state. a llo t m e n t
• Activity
– The rounded circle represents
activities that occur. An activity is I s s u e id e n t it y I s s u e lib r a r y
not necessarily a program, it may be c a rd c a rd
– A merge passes any control flows straight through it. If two or more
inflows are received by a merge symbol, the action pointed to by its
outflow is executed two or more times
Basic Components in an Activity Diagram
• Decision
– A diamond with one flow
entering and several leaving. The
flow leaving includes conditions
as yes/ no state
• Flow final
– The circle with X though it. This
indicates that Process stop at this
point
• Swim lane R e c e iv e d f o r m
be horizontal or vertical
Detailed Activity Diagram of SEIIT
1
R e c e iv e d f o r m
H o s te l
P a y m e n t fe e s M e d ic a l c h e c k
a llo tm e n t
2
I s s u e id e n t it y Is s u e lib r a r y
c a rd c a rd
Detailed Activity Diagram of SEIIT
F ill-in C heck
fo rm fo rm
[In c o r re c t]
R e g re t m e ssa g e
[C o rre c t]
D is p la y s tu d e n t [N o t F o u n d ]
sc re e n
V e rify th e [F o u n d ]
In p u t s tu d e n t a p p lic a tio n s
in fo rm a tio n
C re a te re c o rd 1
S e a rc h fo r S tu d e n t [M a tc h ]
s e le c tio n lis t [N o M a tc h ]
R e g re t
re g is tra tio n
Detailed Activity Diagram of SEIIT
D is p la y C a lc u la te
1 e n ro llm e n t f o rm re g is tra tio n fe e s
D is p a ly fe e s
p a y a b le s c re e n
P ro c e ss
paym ent
P a y fee 2
P rin t re c e ip t
Activity Diagram of SEIIT with Swim Lane
Student
F ill- in
fo rm
V e rify th e [F o u n d ]
[In c o r re c t]
a p p lic a tio n s
[N o t F o u n d ]
C heck
R e g ret m e ssa g e
Registrar
fo rm
[C o rr e c t]
D is p la y s tu d e n t
sc ree n
C re a te re c o rd
System
In p u t s tu d e n t
in fo rm a tio n
[M a tc h ]
1
S e a rc h fo r S tu d e n t
s e le c tio n lis t [N o M a tc h ]
R e g ret
re g is tra tio n
Object and Object Flow
• An object flow is a path along which objects can pass. An
object is shown as a rectangle
• An object flow is shown as a connector with an arrowhead
denoting the direction the object is being passed.
Input and Output Pin
• An object flow must have an object on at least one of its ends.
A shorthand notation for the above diagram would be to use
input and output pins
Data Store
• A data store is shown as an object with the «datastore»
keyword
Expansion Region
• An expansion region is a structured activity region that executes multiple
times. Input and output expansion nodes are drawn as a group of three
boxes representing a multiple selection of items. The keyword iterative,
parallel or stream is shown in the top left corner of the region
Exception Handling
• Exception Handlers can be modeled on activity diagrams as in
the example below
Interruptible Activity Region
• An interruptible activity region surrounds a group of actions that can be
interrupted. In the very simple example below, the Process Order action
will execute until completion, when it will pass control to the Close Order
action, unless a Cancel Request interrupt is received which will pass
control to the Cancel Order action
An Example
• Identify the business logic in the activity diagram shown below
Importance of Activity Diagram
• An activity diagram can depict a model in several ways
• Activity diagram can also be drawn that cross several use cases, or that address just
a small portion of use case
• The activity diagram can be used to develop interaction diagrams which help to
allocate activities to classes
What is a Statechart Diagram?
• A state-chart diagram is used to model the dynamic aspects of the system.
The basic idea is same as the state machine in Finite Automata
• We can draw state diagrams for each object involved in the system
• An object may be in several states of its life time. When a message arrives to
an object (event) it undergoes certain operations (action) or changes its state
• A state diagram shows how an object will react to the arrival of an event
s im p le s t a t e
S ta te 1 S ta te 2
E v e n t1 /A c tio n A
in it ia l s t a t e
E v e n t 2 [g u a r d ] / A c t io n B
E v e n t3
S ta te 3
c o m p o s ite s ta te
f in a l s t a te
Basic Components in a Statechart Diagram
• Two basic elements are there
– Rounded rectangle box representing the state
Nam e
N am e S ta te 1
E n try /A c tio n A E x it /A c tio n C
S ta te V a r ia b le s
E n tr y /A c tio n A
in t e r n a l a c t iv it ie s E v e n t /A c tio n B
E x it /A c tio n C
• If there is no guard or if the guard is true, then for the event the actions will
be followed and it can enter [exit] to [from] a state or remain in the same
state
Statechart Diagram: Example
• Suppose, a COURSE is an object in a usual “Course Registration” use case
(consider the SEIIT). Following is a state diagram to model the behavioral
view of the object COURSE
W ith in
d e a d lin e
P ro p o s e
C o u rs e o ffe r
C o u rs e o p e n
S c h e d u le
fo r
r e g is tr a tio n
D is p a ly
C o u rs e L a s t d a te
a s s ig n e d E n r o ll W ith d r a w
F u ll C lo s e c o u r s e
C o u r s e f u ll
r e g is tr a tio n
S tu d e n t d ro p p e d
V a c c a n c y e x is t
S e s s io n s ta r te d
C o u r s e b e in g
ta u g h t
E v a lu a tio n /S e s s io n e n d
D is p la y Feedback
m a rk s
Advantages of Statechart Diagram
• A statechart diagram is used to model how the state of an
object changes in its life time