NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL NARAYANA ENGINEERING COLLEGE::NELLORE CSE DEPARTMENT III- B.TECH I-SEM UML LAB MANUAL 1
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
NARAYANA ENGINEERING COLLEGE::NELLORE CSE DEPARTMENT
III-B.TECH I-SEM
UML LAB MANUAL
1
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
NARAYANA ENGINEERING COLLEGE::NELLORE DEPARTMENT: CSE
UML LAB MANUAL III-B.TECH I-SEM (2007-08) List of projects:
1) ATM System2) Retail System3) Railway Reservation4) Hospital management5) Hotel management6) Library System
1) ATM System :
Aim: To model the ATM System in UML
Contents: Class diagramUse case diagramSequence diagramActivity diagramCollaboration diagramComponent diagramDeployment diagram
Class diagram: A class diagram shows a relation among set of classes, interfaces, collaborations and their relationships. Class diagram includes active class and is static process view of a system.
2
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
Cash dispensercash
count & dispense cash()
Atm screen
show options()invalid()
Accountaccount typeaccount no
clientnameaccountaddress
insert card()enter amount()take cash()
card readercard no
read no()check()
Use case diagram: A use case diagram shows set of use cases and actions & their relations. They address static view of the system.
3
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
user
insert card
enter pin no
select account type
perform transacton
collect receipt
take card
Atm machine
check the pin no
allow to process Database
update in db
Sequence diagram: A sequence diagram is an interaction diagram that emphasizes time ordering of messages. These address the dynamic view.
4
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
userAtm machine Database
1:
2:
3:
4:
5:
insert card
allow pin no 3 times
check pin no
allow to process
select account type
6: perform transaction
8:
7: update in db
give receipt
collect card9:
Activity diagram: An activity diagram is a special kind of state machine diagram that shows the flow of one activity to another activity within a system.
5
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
insert card
allow to process
enter pin no
invalid pin no
select account type
perform transaction
update in db
give receipt
collect card
No
Collaboration diagram: A collaboration diagram is an interaction diagram that emphasizes the structural organization of objects that send and receive messages.
6
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
user
Atm machine
Database
2: insert card allow 3 times
check pin no
allow to process
select acc typeperform transaction
upadate in db
give receipt
take card
1: 5: 6: 9:
8:
3: 7:
4:
Component diagram: A component diagram shows the organization and dependency among a set of components. It addresses the static implementation view of the system.
user account
cash dispenser
Atm screen
card reader
Deployment diagram: A deployment diagram shows the configuration of runtime processing odes that lie on them. It addresses static deployment view of architecture related to component diagrams in which a node typically encloses one or more components.
7
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
database
Atm server
printer
user1 user2
Conclusion: All the UML diagrams of an ATM System are designed and code generated successfully.
8
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
2) Retail System project:Aim: To model a retail system
Class diagram: The class diagram consists of five classes and relationships of association, dependency and aggregation. The five classes are shop keeper, shop, customer, Assistant and product.
ownerkeyscash book
give salary()give receipt()collect money()
usercashcredit card
buy()return()
asstidsalary
give details()
shopracks
open()close()
productcostbarcode
Use case diagram: The use case diagram shows seven use cases and three actors’ customer, shopkeeper and assistant. Association relationships have been given between actors and corresponding use cases.
9
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
give salary
shop keeper
arrange
Assistant
give bill
collect money
buy
return
customer
give details
Sequence diagram: The sequence diagram shows three objects. The operation being done here is purchasal.There is eight messages in the sequence diagram.
10
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
customer shop keeper Assistant
1: ask product
2: ordered to show product
3:
4:
6:
7:
show
give details
carry product in trolley
pay money
give receipt
carry product to home
5:
8:
11
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
Activity Diagram: The activity diagram shows seven activities to buy products in shop.
ask the product
order to show
show
give details
carry items in trolley
pay money
collect receipt
Collaboration diagram: The collaboration diagram is the isomorphs of the sequence diagram having eight messages and three objects. The objects are shop keeper, customer and assistant.
12
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
customer
shop keeper
Assistant
ask product
order to show show the productgive details
give receipt
pay money
5: 8:
carry items in trolley
take to home
1: 6:
7:
2:
3: 4:
Component diagram: The component diagram has five components & only dependency relation is specified.
shop keeper
assistant
shop
customer
product
Deployment diagram: There are five nodes in the deployment diagram. The assistant and customer nodes are connected to shopkeeper.
13
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
products database
shop keeper recipt printer
assistant
customer
Conclusion: All UML diagrams are designed and code generated successfully.
14
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
3) Railway Reservation : Aim: To model a railway reservation system.
Class diagram: The class diagram has four classes that are passenger, railway employee, ticket dispenser and database.Also, the relations involved are association and dependency.
passennamemoney
select option()req form()fill form()receive()
databasetrain listvacancy
update()
r empemp idtrains db
verify form()issue ticket()update db()
ticket dispenserblank tickets
print()
Use case diagram: The use case diagram consists of two actors that are railway employee and passenger. Each have four four corresponding use cases to a total of eight use cases.
15
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
pay money
passenger
verify availability
check db
update db
issue ticket
request form
fill form
railway emp
submit
Sequence diagram: The sequence diagram shows four objects that are passenger, railway emp, database and ticket dispenser. Eleven messages are sent for the reservation process to complete.
16
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
passenger rail emp database ticket dispenser1:
2:
3:
4:
6:
7:
8:
9:
10:
11:
req form
provide
fill form
submit
verify
check db
5:
update db
calculate fare
pay money
issue ticket
Activity diagram: The activity diagram has ten activities and one decision .The decision is that whether a vacancy is there or not.
17
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
req form
fill form
submit
verify
check db
update db
pay money
issue ticket
calculate fare
seat available
yes
provide form
Collaboration diagram: The collaboration diagram is the isomorphs of sequence diagram. This uses four objects and ten messages are used.
18
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
passenger
rail emp
database
ticket dispenser
3:
8: 5:
req form
provide form
fill form
submit
verify form
check db
update
calculate fare
issue ticket
pay money
1: 4:
10:
2: 11:
6: 7:
9:
Component diagram: The component diagram has four components .Only dependency relationship is used.
passenger
rail emp
database
ticket dispenser
Deployment diagram: The deployment diagram shows four nodes that are devices, database, railway employee and ticket dispenser.
19
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
db
rail emp
passenger
ticket dispenser
Conclusion: All UML diagrams are designed and code is generated successfully.
20
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
4) Hospital management :Aim: To model a hospital system.
Class diagram: The class diagram has three classes’ patient, attender and doctor.Also, dependency and relationships are used.
doctocourse
diagnose()check()give pres()
patiendiseasemoney
take appoint()buy medici()
attendtokens
give token()allow patient()take fee()
Use case diagram: The use case diagram has three actors and eight use cases.
21
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
give token
take fee
attender
doctor
enter into clinic
take appointment
check
diagnosis
patient
give pescription
Sequence diagram: The sequence diagram has three objects and nine operations are involved in the diagram.
22
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
patientattender doctor
1: take appointment
2: take fee
4: wait
5: inform
6: goes to doctor
3: inform
7:
8:
check & diagnose
give prescription
9: leave the hospital
Activity diagram: The activity diagram consists of seven activities .
23
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
enter into clinic
take appointment
take fee
go to doctor
check & diagnose
give prescription
buy medicines
24
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
Collaboration diagram: The collaboration diagram is isomorphs of sequence diagram.
patientattender
doctor
4: 9:
take appointment
collect fee
inform
wait
inform
go to doctor
diagnosegive prescription
leve from hospital
1:
2: 5:
6:
7: 8:
3:
Component diagram: The component diagram consists of three components and only one dependency exists.
patient attender
doctor
Deployment diagram: This diagram consists of four nodes that are database, attender, doctor and patient.
25
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
database
attenderdoctor
patient
Conclusion: All UML diagrams are designed and code is generated successfully.
26
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
5) Hotel management : Aim: To model a hotel management.
Class diagram: The class diagram consists of three classes that are customer, waiter and manager. The relationships are association and dependency.
waitnotepad
show table()give menu()serve()take order()handbill()
custmoneyappetite
see menu()order item()eat()pay bill()
managecash registerchange
welcome()take bill()give change()
Use case diagram: The use case diagram consists of three actors. It also contains six usecases,two to each actor.
27
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
serve
clear table
waiter
manager
give order
cancel order
take bill
customer
welcome
Sequence diagram: The sequence diagram consists of three objects and have eight messages passed in this operation.
28
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
customer waiter manager
1:
2:
4:
3:
5:
7:
8:
show table
take menu
select item
order item
eat
6: give hand bill
pay money
collect change
Activity diagram: The activity diagram consists of ten activities and one decision. The decision is of whether or not to leave the hotel.
29
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
occupy table
take manu
select item
place order
eat
take hand bill
pay money
collect change
empty table
enter hotel
leave
Collaboration diagram: The collaboration diagram consists of three objects. It is the isomorphs of the sequence diagram.
30
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
customer
waiter
manager
3: 5:
show table
take manu
select item
order item
eat
give hand billpay money
collect change
7:
8:
1: 6:
2: 4:
Component diagram: The component diagram consists of three components and only dependency used in this.
customer
waiter
manager
Deployment diagram: The deployment diagram shows run time processing nodes. In this case, there will be four nodes.
31
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
database
manager
customer
waiter
Conclusion: All UML diagrams are built and code generated successfully.
32
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
6) Library System :Aim: To model the library system.
Class diagram: The library system consists of four classes that are librarian, student, library database and fine. It consists of data relating to all available books.
stustud idpass book
issue()return()payfine()
lib dbbooks
add()delete()
libr ianstudent db
issue()delete()add()return()collect fine()
finefine table
enter fine()pending()paid()
33
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
Use case diagram: The use case diagram shows five sets of operations issue,return,add,delete,fine etc.Each of them have their own operation.
add
delete
librarian
issue
return
student
fine
34
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
Sequence diagram: The procedure begins with checking id and ends with return of book and library card.
studentlibrarian library db
1:
2:
3:
4:
5:
6:
7:
8:
check id
req book & submit lib card
check book in db
check lib card
enter book details in lib card
delete book
enter student details in book
return book & libcard
35
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
Activity diagram: This consists of nine activities.
check id
req book
check book in db
check lib card
enter book details in libcard
check fine
delete book from db
enter student details
return book
36
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
Collaboration diagram: The collaboration diagram is isomorphs of the sequence diagram.
studentlibrarian
library db
3: 4: 5: 7:
check id
req book
check book in dbcheck lib card
enter book betails
delete book
enter student details in libcard
return book1: 8:
2:
6:
Component diagram: This diagram consists of four components that are library database, librarian, fine and student. The dependency relations are between student and librarian, librarian and library database.
lib database
librarian
fine student
Deployment diagram: The deployment diagram consists of seven nodes with three students.
37
NARAYANA ENGG COLLEGE, NELLORE – UML LAB MANUAL
librarian
fine student db
lib db
student 1
student 2
student3
Conclusion: All UML diagrams are built and code is generated successfully.
38