UML - ATM Transaction - Class Diagram
5K views
Nov 28, 2024
UML - ATM Transaction - Class Diagram
View Video Transcript
0:00
class diagram on ATM transaction case
0:03
study so in the previous videos we have
0:05
discussed what is the problem statement
0:07
what are the functional and
0:09
non-functional requirements how to draw
0:11
the useless diagram what are the do's
0:14
and don'ts to be followed up when
0:17
drawing the use case diagram in this
0:19
particular video we are going to discuss
0:21
what is the class diagram for this
0:23
respective problem so a class is
0:26
something that encapsulate s--
0:28
information and the barrier behavior
0:30
means the operations the stock the top
0:34
section of the class holds the class
0:35
name and optionally it is stereotype the
0:40
middle section holds the attributes of
0:42
the information that a class is holding
0:45
the lower section that means this
0:47
particular part holds the operations or
0:49
the behavior of a class so that means
0:53
these operations are on the attributes
0:55
which will be in this second section the
0:59
lower section holds the operations or
1:01
the behavior of a class we can also show
1:04
the visibility of each attribute and
1:07
operation data type of each attribute
1:10
and the signature of each operation on
1:13
these diagrams so what are the
1:16
visibility just see here whenever we are
1:19
having these attributes they'll be
1:20
coming with this icons whenever you are
1:23
having the methods or the operations
1:25
they'll be coming with this icon with a
1:27
magenta color and here you see whenever
1:30
you are having something public
1:32
visibility the member variable or the
1:35
attribute with the public visibility
1:37
nothing will come here in case a private
1:40
this lock will be coming here in case of
1:42
protected this key will be coming here
1:45
in case of package this hammer will be
1:47
coming there so these are the symbols
1:49
you will be getting if you work with
1:52
this rational rows software so I have
1:54
taken this one from the rational rows of
1:57
the screenshot so in case of metals in
2:01
case of operations this icons will be
2:03
coming for all of them and they will be
2:05
written or they will be included in the
2:07
third section of this rectangular box
2:09
there is a class and here we are having
2:12
for the public
2:13
no icon will be there for private lock
2:16
for protected we're having key and for
2:19
package we'll be having this hammer
2:21
symbol and this is our class name and
2:23
here the class name must be purposeful
2:25
from the very class name that
2:27
nomenclature should be done in such a
2:28
way that we can get the idea what is the
2:31
purpose of the class so here is the
2:34
class diagram which we are suggesting
2:36
for this ATM transaction case study so
2:39
here we are having this card reader
2:41
having one attribute and we are having
2:43
this set of methods and operations to be
2:46
carried out there is a accept card eject
2:49
card and read card so these are the
2:52
methods were having this is the
2:53
attribute and these are respective class
2:56
name so here you can also mention not
2:58
only the card number but card number :
3:01
in de jure so the respective data type
3:03
cannot be also mentioned here this is a
3:06
ATM screen this is our cash dispenser
3:09
and here we are having this cash balance
3:11
and this two methods are there one is
3:13
the provide cash another one is a
3:14
provide received so here we are having
3:17
this account class and we're having this
3:19
account number pin balance and these are
3:22
the respective operations which can be
3:24
carried out on them there is open read
3:26
griffons withdraw funds deduct funds and
3:29
verify funds so these are the respective
3:32
menthols and operations were having we
3:34
know that in our class diagram also we
3:36
have discussed that one that these
3:38
classes can be divided into two
3:39
different categories one is your
3:41
transient class another one is your
3:43
persistent class so if you click if you
3:46
go if you select this one and go for
3:47
right click on rational rules it will be
3:49
getting their respective property the
3:51
window will come and there you can
3:53
select the radio buttons are there they
3:56
will can select either transient or part
3:58
system whenever you are selecting one
4:00
class has a persistent class then the
4:03
respective DDL can be generated from the
4:05
software and if you run the DDL then
4:08
that on the database the respective
4:10
tables will get created with these
4:12
respective attributes so the respective
4:15
create query create table table name so
4:17
in this way that create queries that DDL
4:19
will get generated in a certain script
4:22
so these facilities are available in
4:25
a proper UML tool so let us go for one
4:28
practical demonstration to show you that
4:30
how this class diagrams can be drawn and
4:32
what are the other features of the
4:34
software using rational rules so here is
4:36
the demonstration for you in this class
4:40
we shall show you how to draw the class
4:42
diagram using rational rule software so
4:46
at first we shall go for the logical
4:47
view and if you double click on this men
4:49
this window will pop up now here we are
4:52
having this respective toolbar
4:54
containing so many different tools
4:56
required for the class diagram so here
4:59
we are having this tool that is a class
5:01
so I'm selecting here I am giving the
5:03
name as class 1 reading another class
5:07
here as class 2
5:14
creating another class here as class
5:16
three okay so here we are having three
5:20
classes we have created red button click
5:22
while going for this new attribute so
5:25
here the syntax is name : type is equal
5:27
to initial value so going for this VAR 1
5:30
1 : integer in this way I am going to
5:33
create another 2
5:41
you
6:24
okay so these are the variables we have
6:26
created here now if we go for the open
6:30
specification then if you go for the
6:32
attributes here we are having the list
6:34
of attributes whatever we have created
6:36
so now these are the attributes we are
6:38
having here and this attribute data type
6:40
can be changed from this drop-down list
6:42
so I think you are getting me that how
6:45
we have changed how we can change the
6:47
attribute data type here so I can go for
6:50
this long type and go for apply then ok
6:52
so now it has got changed in this way so
6:55
you can double click here when you can
6:57
change this one and you can make this
6:59
one as protected if you go for apply
7:01
then these are symbol of the protected
7:03
so if you go for the public go for apply
7:05
it will be of the type public and then
7:08
if you go for the private if you go for
7:10
apply then it is coming with a lock so
7:13
in case of public there will be no key
7:15
no lock you can find it here in cursor
7:18
protected it will be coming with the key
7:20
here and in case of private it will be
7:23
coming with this lock here okay so in
7:26
this way we are having this list of
7:28
variables with the different scopes and
7:30
the data types can be changed from here
7:32
also the data that can be changed from
7:34
here also okay now we have done it now
7:40
whenever will be creating such classes
7:42
it is having mainly three sections so
7:44
one is that containing the class name
7:46
next one is the list of attributes and
7:48
then last one will be the corresponding
7:51
methods to be inserted so here we can go
7:54
for the new operation to insert this
7:56
method but I want to show you something
7:58
different here let us go for the
8:01
sequence diagram here so if you if want
8:04
initiate sequence diagram you are
8:05
supposed to click here and then go for
8:08
the logical view go for okay give a new
8:11
name say new sequence diagram one moving
8:17
for okay so now we have we have created
8:20
this sequence diagram here so now when
8:22
this particular sequence diagram is
8:24
being selected so here this respective
8:26
toolbar will be coming and the class
8:28
will be selected the another toolbar
8:30
will be coming here so now I am going
8:32
for this now going for the right button
8:36
click open specification
8:38
so I'm selecting this class as class 1
8:40
giving the name as object 1 going for
8:43
apply and ok so this is a sequence
8:46
diagram and here we are having this OB 1
8:48
colon class 1 so this is object name it
8:51
is the class name here we are having
8:53
this so now let me go for the another
8:57
insertion of another class here going
8:59
for open specification
9:07
no see until this whatever you have done
9:10
if you go for this compilation if you go
9:13
for this check model you see that is no
9:16
a that is coming there is no error you
9:18
can also come to this check model you
9:19
can find that that is no error here
9:23
there is no either one of the classes
9:26
have got created and it is our check
9:29
model is working fine okay
9:31
no see here from here to here we are
9:36
going for one sequence flow and giving
9:42
the sliminess function one function one
9:45
to function want to go for a plane okay
9:50
so so that is my function one two here
9:55
now if you go for the check model if you
9:58
go for check model it will show some
10:00
error message we can also find this
10:03
error message here so this error message
10:05
it is showing unresolved reference to
10:07
operation with named function one two in
10:10
message function one two between OB one
10:13
and OB two in the sequence diagram new
10:15
sequence diagram one so that is the
10:17
error message it is giving now remember
10:21
whenever you are having such function
10:23
which is which is against this
10:25
particular directed line unit direct
10:28
line from class 1 to class 2 then this
10:31
function must be the member function for
10:34
this class - let me show you this one so
10:37
win for this new operation and here we
10:40
are going for this function 1 2 so this
10:45
is a function we are having so now we
10:48
can this a public one so this is a class
10:50
2 type class and this is my detailing if
10:54
you go for the detailing we are having
10:55
this one so now if you go for the
10:58
respective attributes and operations so
11:01
here you see this operation we are
11:02
having so now go for ok so operation
11:05
means here the method so now if you go
11:08
for the check model you can find that
11:10
there is no error there is no error only
11:13
the check model is being written here so
11:15
that is no error so now if I go for
11:18
another unit Direction line from here to
11:22
here and if you give this name as
11:24
function to one in that case and go for
11:29
applying ok
11:32
so now if I go for this check model once
11:36
again
11:38
there is some error you can find this
11:40
error coming so due to the function to
11:44
one between the object one and object to
11:46
so what we shall do as this particular
11:50
unidirectional this line is is directed
11:53
towards this class one OB one so that's
11:56
why in class one we should include that
11:58
operation so it shall go for function
12:01
two one now if I go for this and if I go
12:06
for this this check model you can find
12:09
that there is no air that is coming
12:10
there is no error is coming so
12:13
arbitrarily we cannot put these
12:15
functions arbitrary we should not put
12:17
these functions and also these functions
12:19
are quite correlated with this sequence
12:22
diagram and what about the functions we
12:24
are mentioning they are to be placed in
12:26
the respective class as the methods
12:29
so all this class diagrams sequence
12:32
diagram all these things are highly
12:34
related so here we can only have the
12:37
object name or the class name or object
12:40
name : class name that means until and
12:43
unless these classes are getting created
12:45
we cannot make them as a heading for
12:47
this sequence diagram so I think you
12:50
were getting my issue that how this
12:52
codes are getting created so now if I if
12:55
I include another function here
12:59
so function two one two I'm going for
13:03
the other one so now if I go for the if
13:06
I select this one go for the double
13:08
click and if you go for this detail and
13:11
if you select this persistent now what
13:13
is the difference between persistent
13:15
class and transient class in case a
13:18
persistent class we are expecting that
13:20
will be one table which will be formed
13:22
against this particular class in the
13:24
underneath layer of database so that can
13:28
also be done here the schema can also be
13:30
produced from this rational rows just
13:33
select this one and Pryor going there
13:35
you should make this one confirm that
13:36
you have made this one persistent and
13:39
then you go for these tools DDL that is
13:44
a data definition language generate code
13:48
select the respective database here this
13:51
is a respective file which will be
13:52
created containing create table class
13:54
one and then we are having this VAR one
13:58
one of the type long word one two of the
14:00
type integer
14:01
so the respective conversions of data
14:03
types will take place depending upon the
14:04
target database and in this way the
14:07
database will get created at the
14:09
respective schema definition will be
14:11
written in this DD L 1 dot SQL script so
14:15
later going to the oracle environment we
14:17
can run this script and all the schemas
14:20
will get will get created at one shot so
14:23
in this way you see the detail
14:25
generation has got completed so DDL one
14:28
toward SQL file will get generated
14:29
accordingly so in this way the
14:32
respective class diagram and the
14:34
sequence diagrams are related so let me
14:37
come to the sequence diagram once again
14:40
so now if you select this one and if you
14:43
go for double-click and here we are
14:45
having the detailing so you can make
14:47
this one synchronous you can make this
14:49
one synchronous if you go for apply and
14:52
then you can find that it is the
14:56
respective symbol has come and here also
14:59
if you make this one as timeout say so
15:02
all these options are there simple
15:03
synchronous bulking timeout and as
15:06
synchronous so if you go for apply and
15:08
then if you go for this respective
15:11
refresh so
15:13
you are getting this particular time of
15:15
notation has come so we got we can also
15:18
have this one we can also go for this so
15:23
there is a self-loop we can do and here
15:25
you can write some descriptions so
15:27
sequence diagrams and class diagrams how
15:30
can we draw them in our rational rule
15:32
software that has been depicted in this
15:35
demonstration
#ATMs & Branch Locations
#Banking
#Programming
#Retail Equipment & Technology