UML - Sequence and collaboration diagram on ATM transaction
15K views
Nov 28, 2024
UML - Sequence and collaboration diagram on ATM transaction
View Video Transcript
0:00
sequence and collaboration diagram on
0:03
the case study ATM transaction so we
0:06
know that sequence and collaboration
0:08
diagram these two diagrams are coming
0:10
under the head that is the interaction
0:12
diagram and he depicts the dynamic view
0:15
of our system so sequence and
0:18
collaboration diagrams are same but
0:20
obviously they must be having some
0:21
difference so that's why they are
0:23
existing side by side in case of
0:26
sequence diagram we usually judge and
0:28
usually follow that what are the
0:30
messages are being passed between two
0:33
objects along with the progress of time
0:35
and in case of collaboration diagram we
0:38
are interested to see the dynamic view
0:41
of the system and which object is
0:45
receiving or sending which message to
0:47
whom so to adjust that one
0:50
the colaboration diagram is there in our
0:53
rational ros software we can easily draw
0:55
the sequence diagram and by pressing f5
0:58
function key 5 we can directly jump to
1:00
the cooler person diagram automatically
1:03
which will be developed by the software
1:05
itself and from the collaboration
1:06
diagram also pressing f5 we can come to
1:09
the sequence diagram so at first we
1:11
shall discuss on the sequence diagram
1:12
then you shall go for the collaboration
1:14
diagram so documenting the flow of
1:17
events the flow of events typically
1:20
includes a brief description that is
1:24
what is the purpose of the Deventer and
1:26
then preconditions when this event can
1:29
take place the preconditions primary
1:31
flow of events what are the flow that
1:33
will take part in the event and then
1:36
we're having this alternative flow of
1:39
events sometimes we might be having some
1:40
condition so depending upon the
1:42
condition true and false we may have
1:44
some alternative flow of events and then
1:47
post conditions that means after
1:48
completion of that particular flow then
1:51
what are the outputs what are the
1:54
effects will be there on the system so
1:56
that is the post conditions so a brief
1:59
description describes that we use case
2:02
we that use case will do that is the
2:06
transport funds use case will allow a
2:08
customer or bank employee to move funds
2:11
from one checking
2:13
or savings account to another checking
2:15
or savings account so that means it is
2:18
telling that in our in our transfer
2:20
funds that is the use case whatever you
2:23
considered in the use case diagram we
2:25
are trying to draw a brief of trying to
2:28
draw our sickles diagram on that
2:29
particular use case so let us go for a
2:32
brief description on it so brief
2:35
description depicts that that it
2:37
describes what that use case will do
2:40
that is transfer funds you skills will
2:43
allow a customer or event employee to
2:46
move funds from one checking or savings
2:49
account to another checking or savings
2:51
account so from the checking account to
2:53
the savings account or from savings to
2:56
savings or checking so savings in this
2:58
way you can have all possible
2:59
combinations so how this transport of
3:02
funds will take place so that is a brief
3:04
description we have provided so next one
3:07
we are having the preconditions so the
3:10
preconditions for a use case list any
3:13
conditions that have to be met before
3:15
the use case can start at all and
3:18
preconditions may be termination of
3:20
another use case so in one use case what
3:24
is the use case that is a functional
3:25
requirement in a system there is a use
3:27
case so what is the process is going to
3:30
get initiated so this use case requires
3:33
some preconditions when the conditions
3:35
are true then the use case will will
3:36
initiate and that precondition might be
3:39
the termination condition for other uses
3:43
so the flow of event describes step by
3:47
step what will happen to execute the
3:50
functionality in the use case the
3:52
primary and the alternate flow of event
3:55
includes so how the use case starts the
3:59
various paths through the use case that
4:02
normal or primary flow through the use
4:05
case any derivation from the primary
4:09
flow and known as the alternate flow
4:12
through the use case any error flows and
4:15
how the use case ends so all these
4:18
things are coming under the topic that
4:21
is a flow of events so I think you can
4:23
easily recall that we are going to cover
4:25
all these points
4:26
beep description we have given here
4:28
preconditions we have given here now we
4:30
are going for this primary flow of
4:31
events ordinary flow of events and then
4:34
will be coming to the post conditions so
4:36
here you can find that here we are
4:38
having what is the primary flow of
4:39
events and alternate flow of events I
4:41
have to I have discussed already that
4:43
whenever a certain condition is true we
4:45
are having the primary flow of events
4:47
when the condition is false we can have
4:48
the alternative flow of events or
4:50
alternate flow of events and whenever
4:52
some errors will come then error flow
4:54
will also take place next we are having
4:58
the primary flow we are going for the
5:00
more detaining the uscles begins when
5:03
the bank customer inserts the card into
5:06
the ATM so now here we are having the
5:08
transfer of funds so that's why this
5:11
particular transfer of funds at first
5:13
the user will enter the ATM card the a
5:16
team presents a welcome message and
5:18
prompts the user to enter their personal
5:20
identification number or pin in the
5:24
previous discussion in the previous
5:25
video we have discussed that in the
5:27
problem statement you got the idea that
5:29
pin will be consisting of 4 numeric
5:32
digits the bank customer enters the pin
5:35
the a team confirms that the pin is
5:38
valid if the pin is not valid alternate
5:41
flow a 1 is performed so that means we
5:44
are having the 1 condition whether the
5:45
pin is valid or not if the pin is not
5:47
valid then alternate flow will take less
5:49
other is a primary flow will work the
5:52
ATM presents the options available
5:54
deposit funds withdraw funds and
5:56
withdraw cash and then transfer funds so
5:59
this that options will be coming because
6:00
transfer of funds can be of multiple
6:03
different types next the user selects
6:07
the withdraw cash option okay
6:10
the a team prompts for the amount to be
6:12
withdrawn the user enters the amount to
6:15
be withdrawn the ATM determines whether
6:18
the amount has sufficient whether the
6:20
account has sufficient funds or not so
6:23
whether this amount can be supported by
6:25
the sufficient fund or not if there are
6:29
insufficient funds alternate flow a2 is
6:31
performed and if there is an error in
6:33
the attempting to verify funds either
6:36
flow II 1 is performed so we're getting
6:39
the alternate flow we
6:40
getting the inner flow depending upon
6:42
whether any error has occurred whether
6:44
my transaction is exceeding my fund
6:47
whatever we are having on my account
6:49
the a-team detox that withdrawal amount
6:51
from the customers account and then the
6:55
ATM provides the customer with the
6:57
requested cash the ATM prints a receipt
7:01
for the customer that point number 13 is
7:04
the ATM ejects the customers card and
7:07
point number 14 is that the use case
7:09
will end in this way so whenever you are
7:12
supposed to do any real-life project
7:14
please follow these steps we are going
7:17
for very elaboration so only to make you
7:20
understand that how to draw the sequence
7:23
diagrams and prior to that how to have
7:25
our different flow control mechanisms so
7:30
alternate flow a1 for what it should be
7:33
initiated for the envelop in so when the
7:36
invalid pin will be entered the ATM
7:38
notifies the customer that the pin
7:40
entered was invalid the a-team makes the
7:43
customers card and the use case ends and
7:46
what is the alternate flow a2 that is
7:49
the insufficient funds so he had that
7:51
conception we had that discussion
7:53
earlier the ATM notifies the customer
7:56
that the amount or the account has
7:58
insufficient found the amount whatever
8:00
is being demanded is not getting support
8:04
from the fund so the ATM ejects the
8:08
customers card and use case ends so this
8:11
is my alternate flow that is a a2 this
8:14
is my alternate flow that is that is my
8:16
a 1 so now let us consider the error
8:19
flow II 1 error in verifying sufficient
8:22
funds so a team notifies the customer
8:25
that an error has occurred in verifying
8:27
the fans and provides the customer with
8:29
the telephone number for the bank's
8:31
customer service support the a-team
8:34
notes the error in the error log the log
8:37
entry includes the date and time of the
8:39
error and the customers name and account
8:41
number and the error code error code
8:44
will denote the error type the a-team
8:47
ejects the customers card and the use
8:49
case ends so we have given you a
8:52
detailed discuss
8:53
that how the steps are to be generated
8:56
whenever you were developing one
8:58
software whenever you were going for
8:59
this email diagram designing especially
9:03
for this sequence diagram and
9:04
collaboration diagram what are the proud
9:06
steps are to be documented so operations
9:10
in the sequence diagram so let us come
9:12
to the sequence diagram directly so the
9:14
process begins when Joey Joey is the
9:16
name of the customer that means the joy
9:18
is nothing but one object under the
9:20
customer insert his card into the card
9:23
reader the card reader reads the number
9:27
on the joyous card then tells the ATM
9:31
screen to initialize itself initiate
9:33
itself the ATM prompts Joey for the pin
9:37
the joy enters his pin that is a four
9:40
digit numeric so one two three four safe
9:42
as an example the a-team opens his
9:45
account
9:46
Joey's pin is validated ATM prompts him
9:50
for a transaction Joey selects the
9:53
transaction type that is a withdrawal
9:55
we're having three options were there so
9:57
we drove has been selected the ATM
10:01
prompts Joey for the withdrawal amount
10:04
Joey
10:05
enters the amount that is $20 the ATM
10:09
verifies that the joyous account has
10:11
sufficient funds and subtract $20 from
10:15
the account the ATM dispenses $20 and
10:19
ejects the Jewess card and the card will
10:22
get ejected so in this way you see we
10:25
have gone for a real life for one
10:27
transaction where the Joey is trying to
10:30
insert his card ATM card with a pin 1 2
10:34
3 4 and tried to he tries to withdraw
10:37
money of say say $20 and then $20 is
10:41
getting checked for that the account is
10:42
having sufficient fund or not and it has
10:45
been accepted approval yes the fund is
10:48
there so $20 will get deducted and then
10:51
cash will be obtained and then this it
10:53
will be obtained and then God will be
10:56
ejected so here is a sequence diagram we
10:59
are having so here this is my actor
11:02
always remember in case of sequence
11:04
diagram these are known as
11:06
time line so this dotted line are known
11:08
as a time line this is our activation
11:11
and this is our object so object means
11:14
we are going to define object under the
11:15
class so what is Joe a Joe is the object
11:18
: that comes from the syntax : and what
11:22
is a customer customer is the name of
11:24
the class and this is accept card ATM
11:27
screen Joe is account and gets dispenser
11:30
we're having this first operation that
11:32
is the accept card then the card number
11:34
will be read initially screen and it
11:37
will be prompted there on the screen it
11:39
will be prompted please enter your PIN
11:40
so prom for the pin so from there here
11:43
the joy will get that prompt he will
11:46
enter the pin say 1 2 3 4 the account
11:49
will open the pin will be verified and
11:52
then then this particular ATM screen
11:56
will prompt for the transaction type
11:58
Joey has selected the transaction type
12:01
as withdraw so I am going for the next
12:04
part so that's why just see here we're
12:06
having 10 9 there so 10 is the next one
12:09
so prom for the account from for the
12:12
amount rather so enter the amount that
12:15
is the $20 and then withdraw funds so
12:18
very very fun so that the we're having
12:20
sufficient balance on the account or not
12:22
deduct this $20 and then provide cash on
12:26
the cash dispenser and then provide the
12:29
disap on the cash dispenser there is a
12:31
trade where the respective the cash and
12:34
the recipient be provided and then we're
12:37
having this eject card and this card
12:39
will be ejected from this accept card so
12:42
here this is the timeline you can follow
12:45
that and you see all of this activation
12:47
time who is sending the message this
12:50
activation time is longer compared to
12:52
the activation time of that object to
12:54
which this message has been sent these
12:57
messages are nothing but where we'll be
12:58
having our methods will be there and
13:00
those methods will be written in the
13:02
respective respective class under which
13:05
this object has been defined we have
13:07
discussed all these issues in our
13:08
sequence diagram chapter collaboration
13:11
diagram chapter class diagram chapters
13:14
you can watch all of them so that you
13:16
can have a good grip over the subject so
13:18
here is the case study
13:19
we were discussing only those aspects
13:22
which are required for the better
13:23
clarification now this is our respective
13:27
collaboration diagram so you see place a
13:30
five or browse induction the minis
13:33
browse then go to collaboration diagram
13:35
to get the collaboration diagram from
13:37
the sequence diagram directly we didn't
13:39
draw this one we actually drew the the
13:43
signal's diagram and done placing a five
13:45
the things will get formed we have dregs
13:48
this particular nodes we drag them so
13:51
that the messages can be seen that
13:53
should not be in the overlapping there
13:55
should not be any crossover of this arcs
13:57
so then return to the sequence diagram
14:00
again pressing f5 you can move this and
14:02
that so here we are having their
14:04
respective the messages which which have
14:06
been passed from here to this from this
14:09
to this these are the respective
14:10
messages and in the case of in case of
14:14
collaboration diagram always the
14:15
messages will be coming with some number
14:17
so these the collaboration diagram the
14:19
messages is coming with the numbers but
14:21
obviously it may depend upon the
14:23
software on which you are trying to draw
14:25
the UML diagrams so that will also make
14:30
decide whether this number will be
14:31
coming or not so let us go for one
14:33
demonstration for the proper
14:35
understanding of this sequence diagram
14:37
and collaboration diagram so here is the
14:39
demonstration for you so in this session
14:43
we shall discuss regarding that sequence
14:45
diagram for the ATM project so we are
14:49
having this Joey : customer here
14:51
customer is a class name and Joey is the
14:54
respective object we're having the
14:56
accept card ATM screen Joey's account
14:59
and cash dispenser so what are the
15:02
operations were going to do in our
15:04
sequence diagram actually we usually
15:06
depict what are the series of operations
15:08
and in which sequence they are supposed
15:11
to be carried out so that the developer
15:13
can get the idea and write the code
15:15
accordingly so accept card will be the
15:18
first operation so customer
15:20
Joey customer this is an accept card is
15:23
a restrictive class so accept card is
15:26
the first operation to be done card read
15:29
card number initialize the screen on
15:32
ATM screen and then prompt for pin the
15:37
pin has been entered has one two three
15:40
four so the inter pin is as one two
15:43
three four the pin will be verified so
15:47
that's why open account verify the pin
15:50
so that is our Joey's account there is
15:52
our database so now prom for the
15:55
transaction
15:56
so from this ATM screen to the customer
15:59
prompt for the transaction select
16:02
transaction withdraw so on the ATM
16:05
screen the particular option will be
16:07
selected prompt for the amount entered
16:11
amount as $20 draw funds
16:15
so this is our choice account so here
16:18
draws fund for $20 the leakers has been
16:20
placed so verify the power funds so that
16:24
is a $20 is there in the font or not
16:26
so deduct the font $20 if it is there if
16:30
the mood balance is there then provide
16:32
the cash against $20 on the cash
16:36
dispenser and then provided in shipped
16:40
from this Joey's account to the cash
16:43
dispenser and then we are having this
16:46
Egypt card so from here to here so Joe
16:50
is the account to the respective accept
16:52
card here and then we're having this
16:56
operation of a 17 is the last one so in
16:59
this way we have gone through this I
17:01
think it will be better if you can show
17:03
such type of sequence diagram on over
17:07
rational rows so opening my rational
17:10
rules so here we have drawn the
17:12
respective a sequence diagram the same
17:14
type of sequence diagram we have drawn
17:16
here so here we are having the
17:18
initialization then enter name and
17:20
password so there is a banking screen
17:22
this is a user and this is a account
17:24
bank so here we are having this okay
17:27
action then check account string and
17:29
string so that's why it is a check
17:32
account so now we will be having this
17:35
get full name and get get this one that
17:38
is a get account so we'll be passing the
17:41
string as input argument so account
17:43
number type and the respective
17:46
so in this way where we have drawn this
17:49
sequence diagram on a banking system so
17:52
how to get the collaboration diagram out
17:54
of it in our rational rules were
17:58
supposed to press only f5 that is a
18:00
function key five to get the respective
18:04
collaboration diagram directly from the
18:06
sequence diagram so I'm pressing f5 for
18:08
my keyboard so if I press a fight then
18:11
this respective collaboration diagram
18:12
will be coming and here you see here it
18:16
is a graphical representation and it is
18:18
showing that how the messages are
18:19
flowing how the messages are flowing
18:22
here so it is giving us the respective
18:25
idea and also there is a all this
18:29
particular it is actually so let me come
18:34
to this so 1 2 3 4 so 4 nodes will be
18:37
will be observing in this respective
18:40
collaboration diagram so the sequence
18:44
diagram will be drawn and the
18:46
collaboration diagram can be obtained
18:48
very easily in rational Row software
18:50
just pressing f5 from the keyboard so
18:53
the collaboration diagram will show us
18:55
that how the message will be flowing
18:57
from one node to another node in this
18:59
graphical representation so we have
19:02
demonstrated how the sequence diagram
19:04
can be drawn and how the respective
19:07
collaboration diagram can be drawn on
19:09
the screen using rational Rho software
19:12
so in case of sequence diagram so if you
19:15
double click on this you are getting
19:17
this detail and here you can change the
19:19
respective synchronization so whether it
19:22
is simple whether it is synchronous
19:24
whether it is bulking timeout or a
19:27
synchronous if you select any one of
19:29
them and then go for apply then go for
19:32
ok and then you can find that that
19:35
respective bulking that very notation
19:37
has come in this directed arrow so if
19:41
you go for that if you go for the
19:43
respective if you want to change the
19:44
text also you can go for that text here
19:46
you can write some class names if we
19:48
require you can also write some class
19:50
names you can go for the detailing for
19:52
this so frequency will be a periodic or
19:55
periodic so all the detailing are there
19:58
you are suppose
19:59
selected respective bullet to make that
20:01
respective synchronization or the
20:03
frequency applicable against that
20:05
unidirectional line thanks for watching
20:08
this video
#Business Plans & Presentations
#Programming