Vous êtes sur la page 1sur 124

Roll No:_____________________

OOAD LAB

INDEX
1. Unified modeling language 2. Use case Introduction 3. Use case diagram a. Use case of ATM machine b. Use case of Library management c. Use case of Railway Reservation System 4. Class introduction 5. Class diagram a. Class diagram of collage management system b. Class diagram of Hospital Management system c. Class diagram of Library management system 6. Interactive diagram Introduction 7. Interactive diagram a. Interactive diagram for ATM machine b. Interactive diagram for Library Management system c. Interactive diagram for Railway Reservation system 8. Collaboration introduction 9. Collaboration diagram a. Collaboration diagram for ATM machine b. Collaboration diagram for Library machine c. Collaboration diagram for Railway Reservation machine 10. State machine diagram 11. State chart diagram for CD player 12. Activity diagram introduction 13. Activity diagram a. Activity diagram of ATM without swinlanes b. Activity diagram of ATM with swinlanes 14. Component diagram introduction 15. Component diagrams a. Component diagram for ATM System b. Component diagram for Hospital Management System 16. Deployment diagram 17. Deployment diagram for ATM system 18. Forward engineering 19. Reverse engineering 20. Case study a. Bank ATM System b. Cellular phone Network c. Student course registration system d. Hospital Management System e. Library Information system f. Ticket vending system g. Trading system 2 8 10 11 12 13 16 17 18 19 22 23 24 25 26 27 28 30 32 33 35 36 37 41 42 43 44 45 54 61 69 79 88 97 107 115

Kakatiya Institute of Technology and Science

Page 1

Roll No:_____________________

OOAD LAB

1 UNIFIED MODELING LANGUAGE


UML is a graphical notation used to visualize, specify, construct and document the artifact of software intensive. UML is appropriate for modeling systems ranging from Enterprise Information Systems to Distributed Web-based Application and even to Hard Real-time Embedded systems. UML effectively starts with forming a conceptual modeling of the language.

There are 2 types of diagrams. They are, 1. Static Diagrams a) Use case diagrams b) Class diagrams c) Object diagrams d) Component diagrams e) Deployment diagrams 2. Dynamic diagrams a) Interaction diagrams i) Sequence diagrams ii) Collaboration diagrams b) State machine diagrams i) State chart diagrams ii) Activity diagrams Applications of UML: UML is intended primarily for software intensive systems. It has been used effectively for such domains as 1. 2. 3. 4. 5. Enterprise Information Systems Banking and Financial Services Telecommunications Transportation Defense and Aerospace
Page 2

Kakatiya Institute of Technology and Science

Roll No:_____________________

OOAD LAB

6. 7. 8. 9.

Retail Medical Electronics Scientific Distributed Web-based Services

Basic building blocks of UML: The building blocks of UML can be categorized as 1. Things 2. Relationships and 3. Diagrams Things:Things are the most important building blocks of UML. Things can be a) b) c) d) Structural Behavioral Grouping Annotational

a) Structural Things: They define the static part of the model. They represent physical and conceptual elements. Following are the structural things 1. Class: - It describes a set of objects that share the same attribute operations, relationships and semantics.
Class name Attributes Operations

2.Object: - It is a collection of operations that specifies a service of a class or a component.

Kakatiya Institute of Technology and Science

Page 3

Roll No:_____________________

OOAD LAB

4. Use case: - They a e used to identify diffe ent use case com onents of a pa ticula softwa e project. It is used to model the operation.

5. Componen : - It is a physical and replaceable part that confirms to and provides realization of set of interfaces.

6. Node: - A physical resource that exists in runtime and represent a computational resource.

7. Actor: - The out side entity that communicates with a system. Typically a person playing a role on an external device.

b) Behavioral Things: They consist of dynamic parts of the UML model. The following are behavioral things
K ti I stitut h i P 4

3. Co abora ion: - It de

es inte action between elements.

Roll No:_____________________

OOAD LAB

1. Interaction: - It is defined as a behavior that consists of a group of message exchanged among elements to accomplish a specific tas .
message

2. State machine: - It is useful when the states of an object in its life cycle. It defines the se uence of states and object goes through in response to events.


c) Grouping Things: They can be defined as a mechanism to group elements of UML model together. There is only one grouping thing available i.e., Package. Package is used for gathering structural and behavioral things.

d) Annotational Things: - They can be defined as a mechanism to capture remarks, description and comments of UML model elements. There is only one annotational thing available i.e., Note. Note is used to render comments, constraints and so on of a UML element.

ti

I stitut

Roll No:_____________________

OOAD LAB

Relationships: The relationship is another most important building block of UML. They show how elements are associated with each other and their association describes the functionality of application. There are 5 types of relationships. They are, 1. Dependency: It is a relationship between two things in which change in one element also affects another.

2. Generalization: It can be defined as a relationship which connects a specialized element with a generalized element. It basically describes inheritance relationship in the object. It is a is_a hierarchy.

3. Realization: It can be defined as a relationship in which two elements are connected. One element describes some responsibility which is not implemented and the other one implement then. This relationship e ists in case of interfaces.


4. Association: It is a set of links that connects elements of an UML model. Two types of associations a) Unidirectional b) Bidirectional c) 5. Aggregation: It is a has_a relationship. It is of two types as a) Simple aggregation b) Composition aggregation

Kakatiya Institute of Technology and Science

Page 6

Roll No:_____________________

OOAD LAB

UML Diagrams: 1. Class diagram 2. Use case diagram 3. Interaction diagram i) Sequence diagram ii) Collaboration diagram 4. State machine diagram i) State chart diagram ii) Activity diagram 5. Component diagram 6. Deployment diagram

Kakatiya Institute of Technology and Science

Page 7

Roll No:_____________________

OOAD LAB

2. USE CASE DIAGRAMS


A use case diagram describes a set of sequences in which each sequence indicates the relation with outside things. A use case involves the interaction of actor and system. There e ist 3 types of relationships1. Association 2. Dependency 3. Generalization Use case diagrams can contain Actors things outside the system Use cases system boundaries identifying what the system should do. Use case diagram can be used during analysi s to capture the system requirements and to understand how the system should work. During the design phase, you can use use-case diagrams to specify the behavior of the system as implemented. Acto :Actor represents system users. They help delimit the system requirements and give a clearer picture of what the system should do. An actor is someone or something that y Interacts with or uses the system. y Provides input to and receives information from the system. y Is e ternal to the system and has no control over the use cases.
  

Customer (actor)

Actors are discovered by e amining, y y y y Who directly uses the system Who is responsible for maintaining the system? External hardware used by the system. Other systems that need to interact with the system.
Page 8


Kakatiya Institute of Technology and Science

Roll No:_____________________

OOAD LAB

Use case: A use case can be described as a specific way of using the system from users (actors) perspective. Use case can be characterized asy A pattern of behavior the system exhibits. y A sequence of related transactions performed by an actor and the system. y Delivering something of value to the actor.

Transfer Funds

Note: Use cases often start with a verb .

Use cases provide a means to, y Capture system requirements. y Communicate with end users and domain experts. y Test the system.

Kakatiya Institute of Technology and Science

Page 9

Roll No:_____________________

OOAD LAB

3.1Use Case for ATM Machine

change password

Withdraw money

Customer Check balance

Database server

Take mini statement

Fig: Use case diagram for ATM System

Kakatiya Institute of Technology and Science

Page 10

Roll No:_____________________

OOAD LAB

3.2Class diagram for Library Management System

search books

Issue books Person Librarian

Renew books

Student

Staff Pay fine

Return books

Fig: Use case diagram for Library Management System

Kakatiya Institute of Technology and Science

Page 11

Roll No:_____________________

OOAD LAB

3.3Class diagram for Railway Reservation System

Enquiry

Checking

Reservation

Train schedule Pay money Passenger ticket Issuer

Berth availability

fares

Issue ticket

Confirmation of ticket

Cancellation of ticket

Fig: Use case diagram for Railway Reservation System

Kakatiya Institute of Technology and Science

Page 12

Roll No:_____________________

OOAD LAB

4.CLASS DIAGRAMS

The class diagram contains icons representing classes, interfaces and their relationships. Class:A class is a set of objects that share a common structure and common behavior (the same attributes, operations and semantics). A class is a abstraction of real-world items. When these items exist in the real-world, they are instances of the class and are referred to as objects. A class icon is a 3-part box.
Class name Attributes Operations

1. Generalize relationship for classes: It shows that sub classes share the structure or behavior defined in one or more super classes. Use a generalize relationship to show is_a relationship.
Super class

Sub class 1

Sub class2

2. Dependency Relationship: The dependency is a relationship between two model elements in which change in one element will affect the other model element. Typically on class diagrams, a dependency relationship indicates that the operations of the client invoke operation of the supplier.

Kakatiya Institute of Technology and Science

Page 13

Roll No:_____________________

OOAD LAB

Ca d nal ty Ado n ent:- Ca d nal ty spec f es how any nstances of one class ay be assoc ated w th s ngle nstance of othe class. When you apply a cardinality adornment to a class, you are indicating number of instances allowed for that class. A relationship, you are indicating number of links allowed between one instance of a class and the instances of another class. Val d Values: Value Description 0..0 zero 0..1 zero or one 0..n zero or more 1..1 one 1..n one or more n unlimited number Inte face:-An interface specifies the externally visible operations of a class and/or component, and has no implementation of its own. An interface specifies only a limited part of behavior o f class or a component. 3. Association relationship: An association provides a pathway of communications. The communication can be between use cases, actors, classes or interfaces. If two classes are usually considered independently, the relationship is an association.
Unidirectional Bi directional
                   

An association is an orthogonal or straight solid line with an arrow at one end.

Customer

Transfer funds

4. Aggregate relationship: Use the aggregate relationship to show a whole or part relationship between two classes.
Kakatiya Institute of Technology and Science Page 1

Roll No:_____________________

OOAD LAB

Unidirectional aggregation

Bidirectional aggregation

The diamond end designates the client class.


Supplier A Client Suppler B

ti

I stitut

Roll No:_____________________

OOAD LAB

5.1Class diagram for Collage Management System

College name : string location : string 1 Add student() remove student() add dep() rem dept() add staff() rem staff() 1 * T&P section stud_id : int stud_name : string Branch : string company name : string Recruitment() * 1 * 1 *

Non teaching staff name : string Qualification : string * * 1 Department 1 * 1 Library Book id : int 1 Issue() renewal() * Collect fine() collect books() 1 * * student id : int name : string Branch : string Enrollment() Attend classes() Attend Exams() * * * Lecturer Subject id : int name : string name : string Designation : string Dept id : int Teaching() 1 Dept num : int Dept name : string Location : string Add subject() Remove subject() 1..*

Fig: Class diagram for College Management System

Kakatiya Institute of Technology and Science

Page 16

Roll No:_____________________

OOAD LAB

5.2Class diagram for Hospital Management System

Medical store medicine name : string medicine cost : int supply medicines() 1

Hospital Name : string Location : string

1 1 Department Dept num : int Dept name : string Location : string <<>maintain doctor records() 1

maintain doctor records() 1 maintain patient records() 1 maintain staff records() 1

Doctors * Name : string Specialization : string perf general checkups() * * pres medicine() pres tests() perf sugery()

* Treatment disease type : string treatment : string Patients Name : string consulting doc name : string * * Bill payment() * *

* Other staff name : string Designation : string

Surgeons

Physicians

Interns

In patient

Out patient

Nurses

Lab tehnicians

Fig: Class diagram for Hospital Management System

Kakatiya Institute of Technology and Science

Page 17

Roll No:_____________________

OOAD LAB

5.3Class diagram for Library Management System

Library Name : string Location : string Issue cards() maintain book details()1 1 Library admin Id : int Name : string Manages library() 1 * * Librarian Id : int Name : string Issue books() 1 renewal() collect fine() collect books() * Operation Book id : int issue() renewal() return() fine() * User id : int Name : string * 1 Take books() pay fine() return books() 1 1 1 * Books Book id : int Title : string Author : string

student

Faculty

Fig: Class diagram for Library Management System

Kakatiya Institute of Technology and Science

Page 18

Roll No:_____________________

OOAD LAB

6.INTERACTION DIAGRAMS

An interaction is an important sequence of interactions between objects. There are two types of interaction diagrams, a) Sequence Diagrams . b) Collaboration diagrams. 1. Sequence D ag a s: A sequence diagram is a graphical view of a scenario that shows object interaction in a time based sequence, what happens first, what happens next. Sequence diagrams establish the roles of objects and help provide essential information to determine class responsibilities and interfaces. A sequence diagram has two dimensions: vertical placement represents time and horizontal placement represents different objects. L nk: Objects interact through their links to other objects. A link is an instance of an association, analogous to an object being instance of a class. A link should exist between two objects, including class utilities, only if there is a relationship between their corresponding classes.
  

Message cons: A message icon represents the communication between objects indicating that an action will follow. The message icon is a horizontal, solid arrow connecting two lifelines together.


Kakatiya Institute of Technology and Science

Page 19

Roll No:_____________________

OOAD LAB

A message icon in a se uence diagram represents exactly one message.


!

Li eline: Each object appearing on the se uence diagram contains a dashed vertical line, called lifeline, which represents the location of an object at a particular point in time. The lifeline also serves as a place for messages to start and stop and a place for the focus of control to reside.
#

Message or Event: a message is a communication carried between two objects that trigger an event. A message is represented in collaboration and se uence diagrams by a message icon which usually indicates its synchronization. Synchronization types that are supported. 1. 2. 3. 4. 5. 6. 7. Simple Synchronous Balking Time out Asynchronous Procedure call Return
#

ti

"

Lifeline

I stitut

Roll No:_____________________

OOAD LAB

Message to self: It is a tool that sends a message from one object back to the same object. The sender of the message is same as the receiver.

Tools: 1. Object

2. Object message 3. Message to self

4. Return message

5. Destruction marker

Kakatiya Institute of Technology and Science

Page 21

Roll No:_____________________

OOAD LAB

7.1 Sequence diagram for ATM System

User 1: Insert atm card

ATM

Database server

2: Check card 3: Invalid:Insert card properly 4: Valid:Display enter pin number 5: Enter pin number 6: Check pin number 7: Valid/Invalid 8: Invalid:Re enter pin number 9: Valid:displays Menu 10: Select withdraw option from menu 11: Enter with draw amount 12: Check for available balance 13: Available/Not 14: Not: Displays menu balance not available

15: Available:Transaction performed 16: Do u want to continue transactions? 17: Close transaction

Fig: Sequence diagram for ATM System

Kakatiya Institute of Technology and Science

Page 22

Roll No:_____________________

OOAD LAB

7.2 Sequence diagram for Collage information System

User 1: Search for required book

Library

Librarian

Database

2: Available/not

3: Available:Takes books 4: Not:Leaves Library 5: Gives ID card for issue of book 6: Checks for validation

7: Valid/Not

8: Invalid:Does not issue 9: Valid:Issue Books 10: Updates Database

11: Renewal of books 12: Checks fine amount 13: Pays fine

14: Updates database

15: Renews books

16: Returns books 17: checks fine amount

18: Pays fine 19: Updates database

20: Books added back

Fig: Sequence diagram Library Management System

Kakatiya Institute of Technology and Science

Page 23

Roll No:_____________________

OOAD LAB

7.3 Sequence diagram for Railway Reservation System

Passenger 1: Enquiry about train

Reservation ounter
$

database

3: Available:Yes/No

4: No:End enquiry

5: yes:Tells the details of train 6: Pay oney for ticket

7: Issues ticket 8: U dates


%

9: 10:

onfirms Reservation ancellation of ticket 11: U dates database


(

Fig: Sequence diagram for Railway Reservation System

Kakatiya Institute of Technology and Science

&%

2:

eck for availability

'

atabase

Page 2

Roll No:_____________________

OOAD LAB

8.Collaboration diagrams:- A collaboration diagram is an interaction diagram that shows the order of messages that implement an operation or a transaction. Collaboration diagrams show objects, their links, and their messages. They can also contain simple class instances and class utility instances. Each collaboration diagram provides a view of the interactions or structural relationships that occur between objects and object-like entities in the current model. Collaboration diagrams contain icon s representing objects. The Create Collaboration Diagram Command creates a collaboration diagram from information contained in the sequence diagram. The Create Sequence Diagram Command creates a sequence diagram from information contained in the interaction's collaboration diagram. The Goto Sequence Diagram and Goto Collaboration Diagram commands traverse between an interaction's two representations.

Kakatiya Institute of Technology and Science

Page 2

Roll No:_____________________

OOAD LAB

9.1. Collaborative diagram for ATM System

2: 1: 5: 10: S 11: 17: M 16: ?

15: 14: N : 9: V 8: 4: V 3: :

: : :R : M 13: 7: V /N / 12:

6:

Fig: Collaboration diagram for ATM System

Kakatiya Institute of Technology and Science

Page 26

Roll No:_____________________

OOAD LAB

9.2. Collaborative diagram for Library Management System

q L L L

G P P B B

Fig: Collaboration diagram for Library management System

Kakatiya Institute of Technology and Science

Page 27

Roll No:_____________________

OOAD LAB

9.3. Collaborative diagram for railway Reservation System

1: Enquiry about train 6: Pay money for ticket 9: Confirms Reservation 10: Cancellation of ticket Passenger 4: No:End enquiry 5: yes:Tells the details of train 7: Issues ticket 2: Check for availability 8: Updates Database 11: Updates database Reservation counter

3: Available:Yes/No

database

Fig: collaboration diagram for Railway Reservation System

Kakatiya Institute of Technology and Science

Page 28

Roll No:_____________________

OOAD LAB

10.STATE-MACHINE DIAGRAMS There are two types of state-machine diagrams: 1. State chart diagram 2. Activity diagram 1. State cha t d ag a : state chart diagrams model the dynamic behavior of individual classes or any other kind of object. They show the sequence of states that an object goes through the events that cause a transition from one state to another and the actions that result from a state change. A state chart diagram is typically used to model the discrete stages of an objects lifetime. A state chart diagram typically contains one start state and multi ple end states. 1. State :- A state represents a condition or situation during the life of an object during which it satisfies some condition or waits for an event. Each state represents a cumulative history of its behavior. States can be shared between state machines. Transitions cannot be shared.
2 0 1 0

Naming: The name of the state must be unique to its enclosing class , within the state. Actions: Actions on states can occur at one of four times y On entry y On exit y Do y On event 2. Sta t state:- A start state (also called an initial state ) explicitly shows the beginning of the execution of the state machine on the state chart diagram or beginning of the workflow on an activity diagram. Normally, one outgoing transition can be placed from the start state.
Kakatiya Institute of Technology and Science
3

Page 29

Roll No:_____________________

OOAD LAB

However, multiple transitions may be placed on start stat e, if at least one of them is labeled with a condition. No incoming transitions are allowed. The start state icon is a small, filled circle that may contain the name (Begin process).
Begin process

3. End state:- An end state represents a final or terminal state on an activity or state chart diagram.. Transitions can only occur into an end state. The end state icon is a filled circle inside a slightly larger unfilled circle that may contain the name (End process).

End process

4. State t ans t on:- A state transition indicates that an action in the source state will perform certain specified actions and enter the destination state when a specified event occurs or when certain conditions are satisfied. A state transition is a relation ship between two states, two activities or between an activity or a state. The icon for a state transition is a line with an arrow head pointing toward the destination state or activity.
5 5 4

We can show one or more state transitions from a state as long as each transition is unique. Transitions originating from a state cannot have the same event, unless there are conditions on the event. Naming: We should label each state transition with the name of at least one event that causes the state transition. We do not have to use unique labels for the state transitions because the same event can cause a transition to many different states or activities.

Kakatiya Institute of Technology and Science

Page 30

Roll No:_____________________

OOAD LAB

Tools: 1. State

2. Activity

3. Start state 4. End state 5. State transition 6. Transition to self 7. orizontal synchronization

8. Vertical synchronization

9. Decision

10. Swimlanes

ti

I stitut

Roll No:_____________________

OOAD LAB

11.1. State chart diagram for CD Player

power on

open

pl y
9

ewind

Forward

S op
7

Fig: State chart diagram for CD Player

Kakatiya Institute of Technology and Science

9 7

Selec song

8 7

Inser

i sk

Pause

Resume song

Page 32

Roll No:_____________________
B CB A

OOAD LAB

12.Activity i r m:- An activity diagram is a special case of state diagram. An activity diagram is like a flow chart showing the flow a control from one activity to another. An activity diagram is used to model dynamic aspect of the system. Activity diagram contains: 1. Activity states and action states 2. Transition 3. Object Action state:- These are atomic, executable computation which represents the execution of an action.

Activity state:- They can be decomposed. That is, their activity is represented by other activity diagrams.

Branching:- In branching, we have one incoming transition and two or more outgoing transitions.
Decision

Forking and Joining:For ing:- It is a process of splitting a single flow of control into multiple flow of controls. Generally a fork has a single incoming flow of control but multi outgoing flow of control.
D

Joining:- It is exactly opposite of forking. It generally has multiple incoming flows of control but single outgoing flow of control.

Swim-lanes:- They represent the columns in the activity diagram to group the related activities. These are represented in the form of partitioned region.
K ti I stitut h i P

Roll No:_____________________

OOAD LAB

Swim-lanes are helpful when modeling a business work flow because they can represent organizational units or role with in a business model. Swim-lanes are very similar to an object because they provide a way to tell who is performing a certain role.

Kakatiya Institute of Technology and Science

Page 3

Roll No:_____________________

OOAD LAB

13.1. Activity diagram for ATM System without swimlanes

Fig: Activity diagram for ATM System without swimlanes

Kakatiya Institute of Technology and Science

QH I eaV d P G G

EaT I FE Hc P P VHa H b G

EaT I FE Hc P P QE

EaT I FE H P P E I X ` P GYG

QH I H FE P G

QT f YP

H WVUE G ET H ER S G

a g

QT eE YP

Check pin number.

F G

Do u want to continue transactions?

Page 3

Roll No:_____________________

OOAD LAB

13.2. Activity diagram for ATM System with swimlanes

Customer

Bank system

I t

Fig: Activity diagram for ATM System with Swimlanes

Kakatiya Institute of Technology and Science

tqs r p xp

ip

h v rs ihsq

h v rs ihsq

xq qp

th

t vs

hv rs ihsq

DO U want to continue Transaction?

hvu vqp

qpyxwh

t v s h

hs rpp

h vu qp h

E t

tqs r qp ih

qpyxwh

Check pin nu ber

Page 36

Roll No:_____________________

OOAD LAB

14. COMPONENT DIAGRAMS They provide a physical view of the current model. A component diagram shows the organizations and dependencies among software components, including source code component, binary code component, and executable component. These diagrams also show the externally visible behavior of the component by displaying the interfaces of the components. Component diagrams contain: 1. Component package 2. Components 3. Interfaces 4. Dependency relationship 1. Co ponent package:- component package represents clusters of logically related components, or major pieces of our system. Component packages parallel the role played by logical packages for class diagrams. They allow us to partition the physical model of the system. Typically, a component package name is the name of a file system directory. The component package is a folder shaped icon.

2. Co ponents:- A component represents a software module (source code, binary code, executable, dll, etc.) with a well defined interfaces. The interfaces of the component are represented by one or several interfaces elements that the component provides. Components are used to show the compiler and runtime dependencies as well as interface and calling dependencies among software modules.

Kakatiya Institute of Technology and Science

Page 37

Roll No:_____________________

OOAD LAB

Interface circle attached to the component icon means that the component supports that particular interface. Co ponent ste eotypes:- A system may be composed of several software modules of different kinds (.exe files, .dll files etc). To distinguish different kinds of software modules from each other, component stereotypes are used. By default, the following stereotypes types of components are available. a) Main program b) Sub program c) Packages d) Tasks e) EXE f) DLL a) Package:- A software component of the type package consists of a specification module and an implementation module; the implementation module often referred to as body. By default, a class is declared in a package.

b) DLL:- A dll component stereotype represents a data link library (a .dll file).

Kakatiya Institute of Technology and Science

Page 38

Roll No:_____________________

OOAD LAB

c) Ma n p og a :- This component represents a file that contains the root of the program. There is only one main program component per program.

d) Sub p og a :- Sub program components corresponds to sub routine declarations. Sub programs generally contain single or grouped sub routines; they do not contain class definitions.

e) Task:- Task components represents package with independent thread of control. If task are compiled differently than regular packages, we can allocate a class definition to a task.

f) EXE:- A component of the type EXE represents executable(.exe file).

Kakatiya Institute of Technology and Science

Page 39

Roll No:_____________________

OOAD LAB

3. Inte face:- An interface specifies the externally-visible operations of a class or component and has no implementation of its own. An interface typically specifies only a limited part of behavior of a class or component. Interfaces belonging to the logical view but can occur in class, use case and component diagram.
d

4. Dependency elat onship:- A dependency relationship between two model elements in which a change to one model element will affect the other model element. Use a dependency relationship to connect model elements with the same level of meaning.
f e

Kakatiya Institute of Technology and Science

Page 0

Roll No:_____________________

OOAD LAB

15.1. Component Diagram for ATM System

ATM

.exe file

ATM Transaction

.h file

database

change pwd

Bal enquiry

Withdrawl

Take mini statement

Fig: Component Diagram for ATM System

Kakatiya Institute of Technology and Science

Page 1

Roll No:_____________________

OOAD LAB

15.2. Component diagram for Hospital Management System

Hospital

.exe file Doctor Department Patients Medical store

.h file

Database general checkup perform surgery prescribe tests prescribe medicines maintain doc records Bill payment Supply medicines

Fig: Component diagram for Hospital Management System

Kakatiya Institute of Technology and Science

Page 2

Roll No:_____________________

OOAD LAB

16. DEPLOYMENT DIAGRAM A deployment diagram shows processors, devices and connections. Each model contains a single deployment diagram which shows the connections between its processors and devices and its processes to processors. Processor:- A processor is a hardware component capable of executing programs. Each processor must have a name, there are no constraints on the processor name because processors denote hardware rather than software entities. The icon for processor is a shaded box.

Device:- A device is a hardware component with no computing power. Each device must have a name. Device names can be generic, such as modem or terminal . The icon of device is a box.

Connection:- A connection represents some type of hardware coupling between two entities. An entity is either a processor or a device. The hardware coupling can be direct such as an RS232 cable or indirect such as satellite -toground communication. Connections are usually bidirectional. The icon for connection is a straight line.

Kakatiya Institute of Technology and Science

Page 3

Roll No:_____________________

OOAD LAB

17.1. Deployment diagram for ATM System

ATM Machine

Modem

Server

ATM card

Fig: Deployment diagram for ATM System

Kakatiya Institute of Technology and Science

Page

Roll No:_____________________

OOAD LAB

18. FORWARD ENGINEERING Forward engineering implies converting the models into software code. This process is usually done by mapping. Procedure: 1. First add Rose C++ using AddIn->Addin manager 2. select class diagram, goto Tools->C++->code generation 3. Again select class diagram, goto Tools->C++->Browser Header

Example-18.1:-

Student Rollno : int Name : char[20] Branch : char[5] Enrollment() Attend classes() Attend exams()

Output:Student.h #ifndef Student_h #define Student_h 1 class Student { public: Student(); Student(const Student &right); ~Student(); Student & operator=(const Student &right); int operator==(const Student &right) const; int operator!=(const Student &right) const;

Kakatiya Institute of Technology and Science

Page

Roll No:_____________________

OOAD LAB

void Enrollment (); void Attend_classes (); void Attend_exams ();

protected : private: const int get_Rollno () const; void set_Rollno ( int value); const char* get_Name () const; void set_Name ( char* value); const char* get_Branch () const; void set_Branch ( char* value); private: int Rollno; char Name[20]; char Branch[5]; }; inline const int Student::get_Rollno () const { return Rollno; } inline void Student::set_Rollno ( int value) { Rollno = value; } inline const char* Student::get_Name () const { return Name; } inline void Student::set_Name ( char* value) { Name = value; } inline const char* Student::get_Branch () const { return Branch; } inline void Student::set_Branch ( char* value) { Branch = value; } #endif

Kakatiya Institute of Technology and Science

Page 6

Roll No:_____________________

OOAD LAB

Exa ple 18.2 :- Generalization


g

S aff Id in Name char[10] Subjec char[10] Dep Id in


h i h i i h h i h

Teaching()

Cleaning() Incharge()

Output:Staff.h #ifndef Staff_h #define Staff_h 1 class Staff { public: Staff(); Staff(const Staff &right); ~Staff(); Staff & operator=(const Staff &right); int operator==(const Staff &right) const; int operator!=(const Staff &right) const; protected : private: const int get_Id () const; void set_Id (int value); const char* get_Name () const; void set_Name ( char* value); const char* get_Subject () const; void set_Subject ( char* value); const int get_Dept_Id () const; void set_Dept_Id ( int value);

Kakatiya Institute of Technology and Science

Teaching S aff
h

Non Teaching S aff

Page 7

Roll No:_____________________
private int Id; char Name[10]; char Subject[10]; int Dept_Id; }; inline const int Staff::get_Id () const { return Id; } inline void Staff::set_Id ( int value) { Id = value; } inline const char* Staff::get_Name () const { return Name; } inline void Staff::set_Name ( char* value) { Name = value; } inline const char* Staff::get_Subject () const { return Subject; } inline void Staff::set_Subject ( char* value) { Subject = value; } inline const int Staff::get_Dept_Id () const { return Dept_Id; } inline void Staff::set_Dept_Id ( int value) { Dept_Id = value; } #endif

OOAD LAB

Teaching Staff.h #ifndef Teaching_Staff_h #define Teaching_Staff_h 1 #include " Staff.h" class Teaching_Staff : public Staff { public: Teaching_Staff();

Kakatiya Institute of Technology and Science

Page 8

Roll No:_____________________
Teaching_Staff( const Teaching_Staff &right); ~Teaching_Staff(); Teaching_Staff & operator=(const Teaching_Staff &right); int operator==(const Teaching_Staff &right) const; int operator!=(const Teaching_Staff &right) const; void Teaching (); protected : private: private: }; #endif Non Teaching Staff.h #ifndef Non_Teaching_Staff_h #define Non_Teaching_Staff_h 1 #include " Staff.h" #include "Teaching Staff.h" class Non_Teaching_Staff : public Teaching_Staff, public Staff { public: Non_Teaching_Staff(); Non_Teaching_Staff( const Non_Teaching_Staff &right); ~Non_Teaching_Staff();

OOAD LAB

Non_Teaching_Staff & operator=(const Non_Teaching_Staff &right); int operator==(const Non_Teaching_Staff &right) const; int operator!=(const Non_Teaching_Staff &right) const; void Cleaning (); void Incharge (); protected : private: private }; #endif

Kakatiya Institute of Technology and Science

Page 9

Roll No:_____________________

OOAD LAB

Exa ple 18.3: Aggregation:


j

Car Brand name : ar[20] Num ate : ar[10] Insurance num : int

Engine Brand name : ar[10] Runs ar()

W eels
Radius : int

Rotates()

Output:

Car.h

#ifndef Car_h #define Car_h 1 #include "Wheels.h" #include "Engine.h"

class Car { public: Car(); Car(const Car &right); ~Car(); Car & operator=(const Car &right); int operator==(const Car &right) const; int operator!=(const Car &right) const;

Kakatiya Institute of Technology and Science

Page 0

Roll No:_____________________

OOAD LAB

const Engine get_the_Engine void set_the_Engine (Engine const Wheels get_the_Wheels void set_the_Wheels (Wheels protected : private:

() const; value); () const; value);

const char* get_Brand_name () const; void set_Brand_name ( char* value); const char* get_Num_plate () const; void set_Num_plate ( char* value); const int get_Insur ance_num () const; void set_Insurance_num ( int value);

private: char Brand_name[20]; char Num_plate[10]; int Insurance_num; Engine the_Engine; Wheels the_Wheels; };

inline const char* Car::get_Brand_name () const { return Brand_name; } inline void Car::set_Brand_name ( char* value) { Brand_name = value; } inline const char* Car::get_Num_plate () const { return Num_plate; } inline void Car::set_Num_plate ( char* value) { Num_plate = value; } inline const int Car::get_Insurance_num () const { return Insurance_num; }

Kakatiya Institute of Technology and Science

Page 1

Roll No:_____________________
inline void Car::set_Insurance_num ( int value) { Insurance_num = value; } inline const Engine Car::get_the_Engine () const { return the_Engine; } inline void Car::set_the_Engine (Engine value) { the_Engine = value; } inline const Wheels Car::get_the_Wheels () const { return the_Wheels; } inline void Car::set_the_Wheels (Wheels value) { the_Wheels = value; } #endif

OOAD LAB

Engine.h #ifndef Engine_h #define Engine_h 1 #include "Car.h" class Engine { public: Engine(); Engine(const Engine &right); ~Engine(); Engine & operator=(const Engine &right); int operator==(const Engine &right) const; int operator!=(const Engine &right) const;

void Runs_car (); const Car * get_the_Car () const; void set_the_Car (Car * value);

Kakatiya Institute of Technology and Science

Page 2

Roll No:_____________________
protected : private: const char* get_Brand_name () const; void set_Brand_name ( char* value); private: char Brand_name[10]; Car *the_Car; };

OOAD LAB

inline const char* Engine::get_Brand_name () const { return Brand_name; } inline void Engine::set_Brand_name ( char* value) { Brand_name = value; }

inline const Car * Engine::get_the_Car () const { return the_Car; } inline void Engine::set_the_Car (Car * value) { the_Car = value; } #endif

Wheels.h

#ifndef Wheels_h #define Wheels_h 1 #include "Car.h"

class Wheels { public: Wheels(); Wheels(const Wheels &right); ~Wheels(); Wheels & operator=(const Wheels &right);

Kakatiya Institute of Technology and Science

Page 3

Roll No:_____________________

OOAD LAB

int operator==(const Wheels &right) const; int operator!=(const Wheels &right) const; void Rotates (); const Car * get_the_Car () const; void set_the_Car (Car * value); protected : private: const int get_Radius () const; void set_Radius ( int value); private: int Radius; Car *the_Car; }; inline const int Wheels::get_Radius () const { return Radius; } inline void Wheels::set_Radius ( int value) { Radius = value; } inline const Car * Wheels::get_the_Car () const { return the_Car; } inline void Wheels::set_the_Car (Car * value) { the_Car = value; }

#endif

Kakatiya Institute of Technology and Science

Page

Roll No:_____________________

OOAD LAB

19. REVERSE ENGINEERING

It involves converting the developed code into models. Procedure: 1. Write the code in notepad. Save it in C:/program files/Rational/Rose/C++/designs/ filename.cpp 2. Tools->C++->Reverse engineering 3. File->new Files->Rose (select filename then click add-selected then select filename and click add-current, finally OK) 4. select filename and press F3(Action->Analyse) for compilation. Then press F8(Action->Export) for running then press OK. 5. Goto rational rose, File->open->path(C:/program files/Rational/Rose/C++/designs)then click F8

Example 1:Class employee { Private: Int id; Char name[20]; Public : Getdata(); };
Kakatiya Institute of Technology and Science Page

Roll No:_____________________

OOAD LAB

Perform 4 steps given in procedure Then, we get output as-

e m p lo ye e id : in t n a m e : ch a r [2 0 ] G e td a ta ()

Example 2:- Generalization

Class staff { Private: Int id; Name:char[20]; Public: getdata(); };

Class tstaff:public staff { Private: Int x;


Kakatiya Institute of Technology and Science Page 6

Roll No:_____________________

OOAD LAB

Public: Putdata(); };

Class ntstaff:public staff { Private: Int y; Public: Display(); };

Perform 4 steps given in procedure Then, we get output asOutput:s ta ff id : in t n a m e : ch a r [2 0 ] g e td a ta ()

n ts taff y : in t D is p la y()

ts ta ff x : in t P u td a ta()

Kakatiya Institute of Technology and Science

Page 7

Roll No:_____________________

OOAD LAB

Example3 :- Aggregation Class car { Public: Char brand_name[20]; Char num_plate[10]; Int ins_num; Class Engine E; Class Door D; Class Wheel W; }; Class Engine { Private: char br_type[10]; Public: void runs_car(); }; Class Door { Public: void open(); Void close(); }; Class Wheel {

Kakatiya Institute of Technology and Science

Page 8

Roll No:_____________________

OOAD LAB

Private :int Radius(); Public : Void Rotates(); };

Perform Above given 4 steps, Then we get,

Output:

car b ra n d _ n a m e : c h a r [2 0 ] n u m _ p la te : ch a r [1 0 ] in s _ n u m : in t 1 D : D oor 1 Wheel +W 1 R a d iu s : in t R o ta te s () E n g in e +E 1 b r_ typ e : c h a r [1 0 ] ru n s _ c a r()

Kakatiya Institute of Technology and Science

Page 9

Roll No:_____________________

OOAD LAB

CASE-STUDY

Kakatiya Institute of Technology and Science

Page 60

Roll No:_____________________

OOAD LAB

CASE STUDY: BANK ATM SYSTEM


Problem statement Each bank provides its own computer to maintain its own accounts and process transactions against them. With this system, a client must first open account before he can use ATM. The opening account involves the client providing his Personal information, and SSI. A client may open one or more accounts for deposit ,withdraw, transfer money between checking and saving account. The client can check the account status 24 hours a day. When the client deposit/withdraw money. The client must specify which account and the amount. Then ATMs communicate with a central computer which clears transactions with the appropriate banks. An ATM accepts a cash card, interacts with the user, communicates with the central system to carry out the transaction, dispenses cash, and prints receipts. The system requires appropriate recordkeeping and security provisions. The system must handle concurrent accesses to the same account correctly. The banks will provide their own software for their own computers.

Functional Requirements The functional requirements are organized in two sections; First requirements of the ATM and second requirements of the bank computer. * Requirements of the ATM - authorization process - transaction (withdrawal process) * Requirements of the bank computer - authorization process (bank code and password) - transaction

Non-functional Requirement The non-functional requirement is bellowed. * The ATM network has to be available 24 hours a day. * Each bank may be processing transactions from several ATMs at the same time. * The ATM must be able to use several data formats according to the data formats that are provided by the database of different banks.

Kakatiya Institute of Technology and Science

Page 61

Roll No:_____________________

OOAD LAB

Usecase Diagram For Bank ATM System

Syste

startup

Operator Syste shutdown

Session Custo er Invalid Pin <<include>> <<extend>>

T ransaction

Bank

ithdrawl

eposit

T ransfer

Enquiry

Kakatiya Institute of Technology and Science

Page 62

Roll No:_____________________

OOAD LAB

Class Diagram For Bank ATM System

A State CustomerNum er Current Customer AccountBank Start State Pin State Account State Transact State ATM() setCustomerNum er() selectCustomer() selectAccount() ithdraw() Deposit() setState()

Bank cus omers ACus omers Bank() readCus omers() addCus omers() findCus omer() Cus omer C eckingAccount SavingsAccount customerNum er pin accounts Coustomer() match() getAccount() ..* BankAccount Balance BankAccount() deposit() withdraw() getAccount()

ATM Simulation

Kakatiya Institute of Technology and Science

Page 63

Roll No:_____________________

OOAD LAB

Sequence Diagram For Bank ATM System

Am In erface : User Inser Card En er n Va da e n

Da abase

Va da e Ok how Op ons Choose Op on e ec W hdraw En er Amoun Check Ba ance Va da e Ok ece ve Cash ema n ng ba ance Ba ance p

Kakatiya Institute of Technology and Science

Page 6

Roll No:_____________________

OOAD LAB

Collaboration Diagram For Bank ATM System

5: Show Options

Atm Interface

1: Insert Card 6: Choose Option 7: Select Withdrawl 2: Enter Pin 8: Enter Amount 11: Receive Cash 13: Balance Slip 4: Validate Ok 10: Validate Ok 12: Remaining balance Database : User 3: Validate Pin 9: Check Balance

Kakatiya Institute of Technology and Science

Page 6

Roll No:_____________________

OOAD LAB

Activity Diagram For Bank ATM System

i ert car

e ter i

ali

ali elect tra acti

m re tra acti

erf rm tra acti

m re tra acti c llect car

Kakatiya Institute of Technology and Science

Page 66

Roll No:_____________________

OOAD LAB

Component Diagram For Bank ATM System

header files atm _main Atm executable files atm_files

Atm database withdrawal change pin

balance

mini statement

Kakatiya Institute of Technology and Science

Page 67

Roll No:_____________________

OOAD LAB

Deployment Diagram For Bank ATM System

ustomer may be ATM card holder,credit,debit card holder or oline user of bank
k

ATM Machine

ATM Machine providing services of ATM transaction

ustomer onsole

Bank Database keeping the details of each and every account

ard Reader
k

Employee onsole
k

WebPage

Each bank employee given a desktop and provided with id,pwd to login into database

ard Reader providing services of credit,debit transaction


k

Webpage providing services of online transaction

Kakatiya Institute of Technology and Science

Bank Database

lient Desktop lient Desktop providing services at desks

Page 68

Roll No:_____________________

OOAD LAB

CASE STUDY:CELLULAR PHONE NETWORK


Problem Statement: In cellular communications networks, cells use beacon frequencies to ensure the smooth operation of the network, for example in handling call handovers from one cell to another. These frequencies are assigned according to a frequency plan, which is updated from time to time, in response to evolving network requirements. The migration from one frequency plan to a new one proceeds in stages, governed by the networks base station controllers. Existing methods result in periods of reduced network availability or performance during the reassignment process. The Study Group was asked to develop an algorithm for implementing a new frequency plan that maintains service quality during the transition. A cellular network usage application is to be developed to assist cellular companies in capacity planning. This application will report on cell tower site usage in two ways 1) immediate notification if a cell tower site's call capacity is being exceeded, and 2) a formatted report on demand, showing calls in progress for a given cell tower site, or for all cell tower sites. This application is not meant to be a simulation or real-time monitoring system of a cellular network, but more of a simple "play back" application, for usage projections. The application monitors cell tower site usage by tracking cell phones as they move around, are turned on and off, originate or receive calls and run out of battery power. Note that calls are tracked in two directions - both originating from the cell phone and received by the cell phone. alls may be made to or received from a cell phone being tracked in the

application, or from an outside number. Assume that the cell phone data comes from previous field monitoring and testing procedures (although randomly generated data or keyed input are other possible data capture sources). Functional Requirements: Cellular Network: A cellular network is a network distributed over land areas called cells, each served by at least one fixed-location known as a or . When joined together these cells provide radio coverage over a wide geographic area. Place Phone call:User places a phone call to the receiver and the cellular network identifies this phone call.

Kakatiya Institute of Technology and Science

Page 69

Roll No:_____________________

OOAD LAB

Receive phone call: User recieves a phone call from the sender and the cellular network identifies this phone call. Place Conference Call: User places a onference call if he need and the cellular network identifies it. Receive additional Call: when reciever is on call and gets an additional call then he holds the present call and receive the additional call.

Non Functional Requirements: a) System should be designed simple enough to enable User to operate the phone without any formal training or delay. b)System must handle Network and power failure. c)System must be efficient to use and provide quick recover from the fault. d) Software must validate and cancel operation in case of incorrect member details,incomplete transaction, and time delay and return failure. e)User interface screen must be designed to operate easily. It should have visual appealing.

Kakatiya Institute of Technology and Science

Page 70

Roll No:_____________________

OOAD LAB

Use Case Diagram For Cellular Phone Network

<<extend>> Place Phone call Cellular network <<extend>> Receive phone call Receive additional call Place conference call

User Use scheduler

Kakatiya Institute of Technology and Science

Page 71

Roll No:_____________________

OOAD LAB

Class Diagram For Cellular Phone Network

Speaker Emit tone()

Dialler Button Digit() Send()

Cellular Radio Connect()

Dialler Display DisplayDigit()

Display

CRDisplay

Kakatiya Institute of Technology and Science

Page 72

Roll No:_____________________

OOAD LAB

Sequence Diagram For Cellular Phone Network

Send:Button

:Send Button Aadapter

:Dialer

:Cellular Radio

DispayCRDi splay

1: Buttonpressed() 2: Send() 3: Connection(pno) 4: Inuse()

Kakatiya Institute of Technology and Science

Page 73

Roll No:_____________________

OOAD LAB

Collaboration Diagram For Cellular Phone Network

1: Buttonpressed() Send:Button :Send Button Aadapter

2: Send() :Dialer

3: Connection(pno)

4: Inuse() :Cellular Radio DispayCR Display

Kakatiya Institute of Technology and Science

Page 7

Roll No:_____________________

OOAD LAB

Activity Diagram For Cellular Phone Network

Process the dial

Busy

Ringingtone

Give busy indication

No response till t sec

Response

Before 1 min Have balance Balance out Cut the service

Kakatiya Institute of Technology and Science

Indicate no balance

Balance Out

Increment the usage time dd Update the balance

After Completion

Page 7

Roll No:_____________________

OOAD LAB

State Chart Diagram For Cellular Phone Network

idle

Off-hook

On-hook Dial Ready to dial Talk

On-hook

Busy

Busy

Connecting

Ringing

Destination Alerted

Time-out

Kakatiya Institute of Technology and Science

Page 76

Roll No:_____________________

OOAD LAB

Component Diagram For Cellular Phone Network

Cellular Network Main Cellular Executable Network Database

Network User

Make Call

Receive Call

Use Scheduler

Receive phone Call Place Phone Call

Kakatiya Institute of Technology and Science

Page 77

Roll No:_____________________

OOAD LAB

Deployment Diagram For Cellular Phone Network

Control console{0 *}
ooo

Central Server

Fixed Installation Tablet PC{0 *}


oo o

Kakatiya Institute of Technology and Science

Page 78

ooo

indow obile Phone

Cell Phone

GPS Controller

GPS ocator {0 *}

Roll No:_____________________

OOAD LAB

CASE STUDY: STUDENT COURSE REGISTRATION SYSTEM

Problem Statement:

At the beginning of each semester students may request a course catalogue containing a list of course offerings for the semester. Information about each course, such as professor, department, and prerequisites will be included to help students make informed decisions. The new on-line registration system will allow students to select four course offerings for the coming semester. In addition, each student will indicate two alternative choices in case a course offering becomes filled or canceled. No course offering will have more than ten students. No course offering will have fewer than three students. A course offering with fewer than three students will be canceled. Once the registration process is completed for a student, the registration system sends information to the billing system, so the student can be billed for the semester. Professors must be able to access the on-line system to indicate which courses they will be teaching. They will also need to see which students signed up for their course offering. For each semester, there is a period of time that students can change their schedules. Students must be able to access the on-line system during this time to add or drop courses. The billing system will credit all students for courses dropped during this period of time. Functional Requirements: Maintain curriculum: This use case is started by the registrar. It provides the capability to create, review, modify, and delete a list of course offerings for a given semester. Maintain Student Information: This use case is started by the registrar. It provides the capability to create, review, modify, and delete student information. Maintain Staff Information: This use case is started by the registrar. It provides the capability to create, review, modify, and delete staff information.

Register for programmer: The use case is started by the student. It provides the capability to create, review, modify, and delete a course schedule for a specified semester.
Kakatiya Institute of Technology and Science Page 79

Roll No:_____________________

OOAD LAB

Write exam: This usecase is started by the student. It provides the capability to write exam. Pay Fee: This usecase is started by the student. It provides the capability to pay fee.

NonFunctional Requirements:
y y

y y

System should be designed simple enough to enable staff to operate enqiry screen without any formal training or delay. System must be secured and protected from the staff and other unauthorized users.A student is allowed only to view and restricted to access/insert/update the other part of the system. Student is not necessary to maintain the staff information,student information and curriculum. Registrar is not necessary to pay fee and write exam.

Kakatiya Institute of Technology and Science

Page 80

Roll No:_____________________

OOAD LAB

UseCase Diagram for Student Course Registration System

maintain currirculum

registrar maintain student information

maintain staff inforamation

register for a programmer

student

write examination

pay fee

Kakatiya Institute of Technology and Science

Page 81

Roll No:_____________________

OOAD LAB

Class diagram For Student Course Registration System

as a

1 1 *
rr t t x wv v

1 assigned to

att

teach

Kakatiya Institute of Technology and Science

rr

1 *
rr

1 * progra e progr na e : char[20]


qq q q

1 *
rr

rr

1 *
t u ss

1 *

1 * student sttudent na e : char[20] studentid : int


rr rr q

provid

staff staffna e : char[20] staffid : int

rr

rr

depart ent deptno : int depna e : char[20]


q

university na e : char[20] location : char[20]


q

1 *

head of

1 *

Page 82

Roll No:_____________________

OOAD LAB

Sequence diagram For Student Course Registration System

student

appli ation

inteview

admission

1: send 2: attend

3: [pass]admit

Kakatiya Institute of Technology and Science

Page 83

Roll No:_____________________

OOAD LAB

Collaboration diagram For Student Course Registration System

1: send student appli ation

3: [pass]admit 2: attend

inteview

admission

Kakatiya Institute of Technology and Science

Page 8

Roll No:_____________________

OOAD LAB

State chart diagram For Student Course Registration System


start addstudent[c<n]

intialization
z{

do intialize batch

add student/ set c=0


|

open
entr register student e it/ increment student

do notif registerd students

Kakatiya Institute of Technology and Science

cancel cancel

[c=n]

canceled
z

close cancel
do/ finalize batch

end

Page 8

Roll No:_____________________

OOAD LAB

Component diagram For Student Course Registration System

registration main

courses

registration executable

student

database application interview admission

Kakatiya Institute of Technology and Science

Page 86

Roll No:_____________________

OOAD LAB

Deployment Diagram for Student Course Registration System

Kakatiya Institute of Technology and Science

Page 87

Roll No:_____________________

OOAD LAB

CASE STUDY : HOSPITAL MANAGEMENT SYSTEM

Problem Statement: Due to budget cutbacks and general concern for providing the best service possible to the public, we as a hospital would like to ensure that we are using our scarce hospital resources in the most efficient manner possible. With this in mind we would like you to design a system which will help us manage our hospital in an efficient, effective manner. Specifically the system should help us schedule and monitor the various resources that we have at the hospital. This includes keeping track of available beds, waiting lists for patients, patients expected length of stay, scheduling of surgeries, patient notification and billing, scheduling of nurses and doctors. This function of the Hospital Management Information System deals with registering new patients, for either OPD or IPD and issuing unique identification numbers to the patients. These numbers are unique throughout the system. A patient can be registered either at the IPD front office or at the OPD reception. The OPD or IPD identification number is also created for each of the patient's separate visits. This also serves as a part of patient registration. The IPD/OPD ID is used for tracking the medical records of the patient for that particular OPD visit or IPD admission. All medical records of the patient are identified by a combination of numbers, i.e. Patient ID and OPD/IPD ID. The numbers allow for a flexible search in terms of finding the patient's history record. Functional requirements: Prescription: This Module handles various activities such as Doctor Diagnoses the patient, gives treatment & gives suggestions to the patients & prescribes laboratory tests& medicines. Operation This is initiated by the doctor and diagnosing the patients. undergoes the various operations by

Kakatiya Institute of Technology and Science

Page 88

Roll No:_____________________

OOAD LAB

Checking: This is initiated by doctor who treats patients came for checking. Patients tells the problem so that the doctor gives prescription according to his problem. Receptionist: The person who gives the details of doctors, requirements available in the hospital, gives the appointment to the patient and collects the fee from the patient.

NonFunctional requirements a)System should be designed simple enough to enable receptionist to operate enqiry screen without any formal training or delay. b)System must be secured and protected from the staff and other unauthorized users.A patient is allowed only to view and access the enquiry and restricted to access /insert/update the other part of the system. c)Staff members must know the correct functioning of the equipments in the hospitai. d)Doctors must be available in any critical situation.

Kakatiya Institute of Technology and Science

Page 89

Roll No:_____________________

OOAD LAB

Use Case for Hospital Management System

Kakatiya Institute of Technology and Science

Page 90

Roll No:_____________________

OOAD LAB

Class Diagram For Hospital Management System

hospital name : char[20] Goes to has a medical shop

has a

ambulance

has a

has a

patients name : char[20]

wards name : char[20]

staff name : char[20]

is a Treatment doctor name : char[20]

is a

is a workers name : char[20]

nurses name : char[20]

Kakatiya Institute of Technology and Science

Page 91

Roll No:_____________________

OOAD LAB

Sequence Di

For Hospi l Management System

Doctor Patient

Patient Doctor

interface receptionist diagnostic 1: Patients name,age 2: Collect fees

3: Checks patients 4: Perform some op 5: Gets Report

6: Gives prescription

ti

I stitut

Roll No:_____________________

OOAD LAB

Collaboration Diagram For Hospital Management System

3 rf r 6 r f 5 r r r

, rf r

Kakatiya Institute of Technology and Science

Page 93

Roll No:_____________________

OOAD LAB

Activity Diagram For Hospital Management System

Doc or

c ec pa ent NO erform opera on

ye

Pre cription

Pre cr ptio n

Kakatiya Institute of Technology and Science

Page 9

Roll No:_____________________

OOAD LAB

Component Diagram For Hospital Management System

Hospital Header files Hospital Main Doctor Specification

Diagnosis Hospital Executable File Department Receptionist Patient Testing

data base Name Id Chief doctor Name Age Appointment

Result Patient Records

Kakatiya Institute of Technology and Science

Page 9

Roll No:_____________________

OOAD LAB

Deployment Diagram for Hospital Management System

Disease UNT Server

artifact Contains Information about

Receptionist PC

articfact User Friendly Screens

Kakatiya Institute of Technology and Science

Page 96

Roll No:_____________________

OOAD LAB

CASE STUDY: LIBRARY INFORMATION SYSTEM

Problem Statement: Problems that are facing by the users while using the current Library system. The current system of the university doesnt allow users to login from different campuses. 1. As it is not available online every student calls up to find out if the book is available or not. - Too many calls to answer 2. Every time a student calls for a book you have to check the racks for the availability of the book. - Too much of physical work. . If some one reserves the book, hes not sure if he definitely can get the book as the previous student may not return in time. 4. Either the student has to call or come to the library to reserve the book, but cannot reserve online over the internet. . Fines have to be calculated manually. . Students have no idea to check their account. Functional Requirements: a)Member of library All the staff and student members of the college can become a member and obtain the library card of library by showing id card issued by the college. b)Article A college library has books,journals audio and vedio and cassettes and DROMS.They are collectively called as articles in the library. c)Lend Article A library member can borrow maximum of 4 books for the period of 1 days. d)Return of the Article A library member can return an article. In case of default over due charges will be levied. e)Renewal of Article A library member can renew the article borrowed,when other library members donot reserve it. f)Loss of Article Loss of Issued Articles should be reported immediately to the librarian. g)Loss of Member card Loss of Member card should be reported immediately to the librarian. h)Enquiry Library member can enquire about the articles details availability and their possible return dates in case of issued.

Kakatiya Institute of Technology and Science

Page 97

Roll No:_____________________

OOAD LAB

i)Reservation A Library member can reserve an article that is not currently available in the library. Non-Functional Requirements a) System should be designed simple enough to enable library member to operate enquiry screen without any formal training or delay. b)System must be secured and protected from library members and other unauthorized users. A member is allowed only to view and access the enquiry and restricted to access/insert/update the other part of system.A member can borrow, reserve or return book only through a librarian. c)System must handle Network and power failure. d)System must be efficient to use and provide quick recover from the fault. e) Software must validate and cancel operation in case of incorrect member details,incomplete transaction, and time delay and return failure. f)User interface screen must be designed to operate easily. It should have visual appealing.

Kakatiya Institute of Technology and Science

Page 98

Roll No:_____________________

OOAD LAB

Usecase Diagram For Library Information System

Enquiry

MakeReservation Me ber

Article Renewal

Librarian

Re ove reservation

Lend article

Return of article

Kakatiya Institute of Technology and Science

Page 99

Roll No:_____________________

OOAD LAB

Class diagram For Library Information System

0..*

newarticle() removearticle() lendarticle() returnarticle() renewal() 0..*

0..* Updat s
}

c py f
~ ~

0..*

newtitle() removetitle() addnalpurchase()

Kakatiya Institute of Technology and Science

Title Titleid type copies price aut or publications edition reservedcopies issuedcopies

r s rv s

Article articleid availabilit issuedate returndate

Utiliz s

Member memberid name address borrowinglimit newmember() removemember()

Fineamount fineamt Pay aiddate 0..* payfine() receipt() collection()

Page 100

Roll No:_____________________

OOAD LAB

Sequence Diagram For Library Information System

: Librarian

Front Panel:Lend...

: itle

: rticle

: ember

1: Lending details( itle, ember) 2: Validate:Find Borrowing Limit 3: Borrow limit ok 4: Find availability 5: vailable OK 6: Update issue details 7: Update available copy

8: Update book borrowed

9: Close

Kakatiya Institute of Technology and Science

Page 101

Roll No:_____________________

OOAD LAB

Collaboration Diagram For Library Information System

4: Find availability 1: Lending details(Title,Member) 7: Update available copy 9: Close Front Panel:Lending :Title Window 5: Available OK : Librarian

6: Update issue details 3: Borrow limit ok

2: Validate:Find Borrowing Limit 8: Update book borrowed

:Article

:Member

Kakatiya Institute of Technology and Science

Page 102

Roll No:_____________________

OOAD LAB

State Chart Diagram For Library Information System

Title reservation/reserved copies++ Not reserved


entry/ reservation:=0

Reserved

Reservation removed / reserved copies--

Kakatiya Institute of Technology and Science

Page 103

Roll No:_____________________

OOAD LAB

Activity Diagram For Library Information System

start

Acquire title,member information

IF

available

Issue article

not available

Reserve article add one with titles reserved

Kakatiya Institute of Technology and Science

Page 10

Roll No:_____________________

OOAD LAB

Component Diagram For Library Information System

Library main Library executable

Librarian

Member

Library database

Article renewal

Remove Reservation

Return Article

Make reservation

Enquiry

Kakatiya Institute of Technology and Science

Page 10

Roll No:_____________________

OOAD LAB

Deployment Diagram For Library Information System

Node1: Library Information Server

Node 2: Counter PC

Kakatiya Institute of Technology and Science

Page 106

Roll No:_____________________

OOAD LAB

CASE STUDY:TICKET VENDING SYSTEM

Problem Statement: A Ticket Vending System(TVM) dispenses tickets to passengers at a railway station.Passengers use the front panel to specify their oarding and destination place,details

of passengers(number of adults and children) and date of travel.The machine displays the fare for the requested ticket.The passengers then deposits cash in the bin provided and presses accept cash.The machine checks the cash,if it is more,the balance cash is paid out.And the ticket requested is printed.The system is also used by the operator who might want to knowthe cash held in the machine,the break-up of small change available in the machine,withdraw or deposit cash when need.And the report options also include the detailed report of trasactions,summary report of the number of tickets sold for each destication,opening balance,each collected,cash dispensed and current balance in the machine.

Functional Requirements:

Specify

Ticket

details:Initiated

by

the

passengers

and

gives

the

following

details:Destination place,date of journey,passengers details(adults,child) and coach details. Buy ticket:Initiated by the passenger to buy ticket,the passenger pays cash and presses accept cash button.the system checks out the cash and print out the ticket and dispense the balance if any.The system also updates the records to reflect the number of tickets to each designation,the total cash collected,total cash dispensed,current balance etc., Summary report:Initiated by the operator to know the summary of the total business transacted for the day,the cash collected and balance cash available in the system. Get cash details: Initiated by the operator to get a denomination wise number of notes and
coins available with the machine at that time. The operator connects from a remote place to vending machine to get cash details.

Withdraw cash: Initiated by the operator to withdraw cash from the machine. The operator connects to the machine locally and the machine dispenses cash.

Kakatiya Institute of Technology and Science

Page 107

Roll No:_____________________

OOAD LAB

Deposit cash :Initiated by the operator to deposit cash in the machine. The operator connects to the machine locally and specifies the amount to be deposited with the denomination details. Check Master files: Initiated by the system administrator. System administrator can log in from a remote place and check the details of machine-id, user-id, password and ticket, balance details. Update Master: Initiated by the system administrator to update system details. Non Functional Requirements: a) System should be designed simple enough to enable operators to get summary reports,get chas details, withdraw cash and deposit cash without any delay. b)System must be secured and protected from passengers and other unauthorized users. A passenger is allowed only to enquire ticket details and buy ticket. c)System Administrator must only check and update master files. d)System must handle Network and power failure. e)System must be efficient to use and provide quick recover from the fault. f) Software must validate and cancel operation in case of incorrect passenger details,incomplete transaction, and time delay and return failure. g)User interface screen must be designed to operate easily. It should have visual appealing.

Kakatiya Institute of Technology and Science

Page 108

Roll No:_____________________

OOAD LAB

Usecase Diagram For Ticket Vending System

specific ticket details Passenger y ticket check master files Summary report System Administrators

Get cas Details Operator

pdate master files

Withdraw cash

Deposit Cash

Kakatiya Institute of Technology and Science

Page 109

Roll No:_____________________

OOAD LAB

Class Diagram For Ticket Vending System

rontPanel

ah Denomination

Re uistionslip startingplace destinationplace tra eldate passenger[ ] age[ ] remark[ ] fare Printer

icket Note Denomination Denomination

Report

Summary

Receipt

De itNote

Kakatiya Institute of Technology and Science

Page 110

Roll No:_____________________

OOAD LAB

Sequence Diagram For Ticket Vending System

7 8

Kakatiya Institute of Technology and Science

Page 111

Roll No:_____________________

OOAD LAB

Collaboration Diagram For Ticket Vending System

1 Ticket Request Front Panel Passenger P 8 Indicate Fare

2 Generate Request Ticket transacter 7 Fare

6 Fare 3 PrepareSlip

4 Get Fare Requisiti onslip 5 Fare Farecalc ulator

Kakatiya Institute of Technology and Science

Page 112

Roll No:_____________________

OOAD LAB

Activity Diagram For Ticket Vending System

Start

specify ticket details

Check master files

Ticket A aila le Buy Ticket

Tickets not a aila le

Get cash details

Pay cash

Update master Files

Kakatiya Institute of Technology and Science

Page 113

Roll No:_____________________

OOAD LAB

Component Diagram For Ticket Vending System

Ticket Vending Main Ticket Vending Executable File

Operator

Passenger

TicketVendingDatabas e

Deposit Cash

Withdraw cash

Summary Report

Buy Ticket

Ticket Details

Kakatiya Institute of Technology and Science

Page 11

Roll No:_____________________

OOAD LAB

Deployment Diagram For Ticket Vending System

Ticket Vending Main Server

server1

server2

server3

Kakatiya Institute of Technology and Science

Page 11

Roll No:_____________________

OOAD LAB

CASE STUDY: TRADING SYSTEM

Problem Statement

The Trading System must take care of sales information of the company and must analyze the potential of the trade. A Trading System processes live market data from the Data Provider using compute resources hosted by the Compute Provider, running software from the Software Provider to supply processed data to the customer. A Trading System demands a high availability of resources. Non-availability of resources means an absence in market trading which, in turn, can lead to missed opportunities. Security is of paramount importance. In addition, regulatory issues exist within institutions that place restrictions on the accessibility of spatial information across their distributed enterprises.

Functional Requrements: Place order: This module is initiated by the customer to place a order. Track order: This module is initiated by the customer to track order. Ship order: This module is initiated by the customer in which all orders will be shipped without delay. Ship Partial order:This module is initiated by customer in which all orders will be shipped partially. Bill customer: This module is initiated by customer to bill the consumer (for credit card use only). Validate customer: This module is initiated to check for the validation of the customer Non Functional Requrements: a)System should be designed simple enough to enable customer to operate enqiry place, track, ship, partial ship order without any delay. b)System must be secured and protected from the customer and other unauthorized users.A student is allowed only to view and restricted to access/insert/update the other part of the system.

Kakatiya Institute of Technology and Science

Page 116

Roll No:_____________________

OOAD LAB

c)System should handle Network and power failure. d)Software must be efficient to use and provide quick recover from the fault.

Kakatiya Institute of Technology and Science

Page 117

Roll No:_____________________

OOAD LAB

Usecase Diagram For Trading System

Place order

<<include>> <<include>>

Track order

<<include>> Validate Customer

Ship order

Customer

Ship partial order

Bill customer

Kakatiya Institute of Technology and Science

Page 118

Roll No:_____________________

OOAD LAB

Class Diagram For Trading System

Cust e a e a ess phone

Places

Order Item quantity 1

P oduct Id Na e 1..* P ice Location

Prepare Process Invoice ansaction Shipment Stock

Kakatiya Institute of Technology and Science

Page 119

Roll No:_____________________

OOAD LAB

Sequence Diagram For Trading System

Order taken Customer

Order fulfillment

Billing agent

1: Submit Order 2: Place order 3: Trigger bill 4: Acknowledge order

Kakatiya Institute of Technology and Science

Page 120

Roll No:_____________________

OOAD LAB

Collaboration Diagram For Trading System

1: Sub it Order

Order taken

usto er : usto er

4: ckno ledge order

2: Place order

: rigger bill Order fulfill ent

illing agent

Kakatiya Institute of Technology and Science

Page 121

Roll No:_____________________

OOAD LAB

Activity Diagram With SwimLanes options For Trading System

Customer

Sales

Request Service Take order

Fill order

Pay

Deliver Order

Collect order

Kakatiya Institute of Technology and Science

Page 122

Roll No:_____________________

OOAD LAB

Component Diagram For Trading System

Trading Main Trading System Executable File

Customer

Sales Person

Trading Database

Give rder

Place rder

Track rder

Bill customer

Kakatiya Institute of Technology and Science

Page 123

Roll No:_____________________

OOAD LAB

Deployment Diagram For Trading System

Purchase Stock Balance Reorder Check

Place order Receiver rder

Kakatiya Institute of Technology and Science

Page 12