You are on page 1of 38

NARAYANA ENGG COLLEGE, NELLORE UML LAB MANUAL

NARAYANA ENGINEERING COLLEGE::NELLORE CSE DEPARTMENT III-B.TECH I-SEM

UML LAB MANUAL

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) 2) 3) 4) 5) 6) ATM System Retail System Railway Reservation Hospital management Hotel management Library System

1) ATM System : Aim: To model the ATM System in UML Contents: Class diagram Use case diagram Sequence diagram Activity diagram Collaboration diagram Component diagram Deployment 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.

NARAYANA ENGG COLLEGE, NELLORE UML LAB MANUAL

client
name account address insert card() enter amount() take cash()

Account
account type account no

card reader
card no read no() check()

Atm screen
show options() invalid()

Cash dispenser
cash count & dispense cash()

Use case diagram: A use case diagram shows set of use cases and actions & their relations. They address static view of the system.

NARAYANA ENGG COLLEGE, NELLORE UML LAB MANUAL

insert card

enter pin no

select account type

check the pin no

user

perform transacton

Atm machine

allow to process

Database

collect receipt update in db

take card

Sequence diagram: A sequence diagram is an interaction diagram that emphasizes time ordering of messages. These address the dynamic view.

NARAYANA ENGG COLLEGE, NELLORE UML LAB MANUAL

user 1:

Atm machine insert card

Database

2: allow pin no 3 times 3: check pin no 4: allow to process 5: select account type 6: perform transaction 7: update in db 8: give receipt 9: collect card

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.

NARAYANA ENGG COLLEGE, NELLORE UML LAB MANUAL

insert card

enter pin no

invalid pin no No allow to process select account type perform transaction update in db

give receipt

collect card

Collaboration diagram: A collaboration diagram is an interaction diagram that emphasizes the structural organization of objects that send and receive messages.

NARAYANA ENGG COLLEGE, NELLORE UML LAB MANUAL

user

1: insert card 5: select acc type 6: perform transaction 9: take card 8: give receipt

2: allow 3 times

Atm machine

allow to process 4: 3: check pin no 7: upadate in db

Databas e

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

card reader

Atm screen

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.

NARAYANA ENGG COLLEGE, NELLORE UML LAB MANUAL

databa se

Atm server

printer

user1

user2

Conclusion: All the UML diagrams of an ATM System are designed and code generated successfully.

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.

owner
keys cash book give salary() give receipt() collect money()

shop
racks open() close()

user
cash credit card buy() return()

asst
id salary give details()

product
cost barcode

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.

NARAYANA ENGG COLLEGE, NELLORE UML LAB MANUAL

give bill

collect money customer buy

shop keeper

return

give salary

give details Assistant arrange

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 1: ask product

shop keeper

Assistant

2: 3: show

ordered to show product

4: give details carry product 5: in trolley pay money give receipt 7: carry product to home

6:

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

carry items in trolley 5: 8: take to home

custome r

1: ask product 6: pay money 7:give receipt shop keeper

show the product 3:give details 4: Assistan t

order to show 2:

Component diagram: The component diagram has five components & only dependency relation is specified. shop

shop keeper

customer

assistant

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

custo mer assist ant

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. passen
name money select option() req form() fill form() receive()

r emp
emp id trains db verify form() issue ticket() update db()

ticket dispenser
blank tickets print()

database
train list vacancy update()

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

request form

fill form

submit

verify availability passenger railway emp

check db

update db

pay money

issue ticket

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 1: req form 2: provide 3:

rail emp

database

ticket dispenser

fill form 4: submit 5: verify 6: 7: check db update db 8: calculate fare 9: print 10: pay money

11: 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 provide form fill form

submit

verify

check db

seat available yes update db

calculate fare

pay money

issue ticket

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

fill form 3: req form 1: 4:submit pay money 10: passeng er provide form 2: 11:

5: verify form 8: calculate fare

rail emp

9: check db 6: 7: update databas e ticket dispenser

issue ticket

Component diagram: The component diagram has four components .Only dependency relationship is used. passeng er rail emp

databas e

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. patien
disease money take appoint() buy medici()

attend
tokens give token() allow patient() take fee()

docto
course diagnose() check() give pres()

Use case diagram: The use case diagram has three actors and eight use cases.

21

NARAYANA ENGG COLLEGE, NELLORE UML LAB MANUAL

enter into clinic

take appointment attender give token patient take fee

check

diagnosis

doctor

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

patient 1: take appointment 2: take fee

attender

doctor

3: 4: wait

inform

5: inform 6: goes to doctor 7: check & diagnose

8:

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.


wait 4: 9: leve from hospital

1: take appointment patient collect fee 2: 5: inform go to doctor 6: diagnose give prescription 7: 8: 3: inform

attender

doctor

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

attender

doctor

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. cust
money appetite see menu() order item() eat() pay bill()

wait
notepad show table() give menu() serve() take order() handbill()

manage
cash register change 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

give order

cancel order customer serve waiter

clear table

welcome

manager

take bill

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 1: show table 2: take menu

waiter

manager

3:

select item 4: order item

5:

eat 6: give hand bill

7: pay money

8: 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

enter hotel empty table occupy table take manu

select item

place order

eat

take hand bill

pay money

collect change 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

3: select item 5: eat take manu custome r 2: 4: order item waiter 1: show table 6: give hand bill 7: collect change 8: pay money

manager

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 waiter

customer

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. libr ian
student db issue() delete() add() return() collect fine()

stu
stud id pass book issue() return() payfine()

lib db
books add() delete()

fine
fine 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.

issue

return

student

add

librarian

delete

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. student

librarian 1: check id

library db

2: req book & submit lib card 3: check book in db

4:

check lib card

5:

enter book details in lib card delete book

6: 7: 8: return book & libcard

enter student details in book

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.


3: 4: 5: 7: check book in db check lib card enter book betails enter student details in libcard

2: student 1: 8:

req book librarian

check id return book 6: delete book

library db

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

fine

studen t db

lib db

librarian

studen t1

studen t2

studen t3

Conclusion: All UML diagrams are built and code is generated successfully.

38

You might also like