uml

148
Roll No:_____________________ OOAD LAB INDEX 1. Unified modeling language 2 2. Use case Introduction 8 3. Use case diagram a. Use case of ATM machine 10 b. Use case of Library management 11 c. Use case of Railway Reservation System 12 4. Class introduction 13 5. Class diagram a. Class diagram of collage management system 16 b. Class diagram of Hospital Management system 17 c. Class diagram of Library management system 18 6. Interactive diagram Introduction 19 7. Interactive diagram a. Interactive diagram for ATM machine 22 b. Interactive diagram for Library Management system 23 c. Interactive diagram for Railway Reservation system 24 8. Collaboration introduction 25 9. Collaboration diagram a. Collaboration diagram for ATM machine 26 b. Collaboration diagram for Library machine 27 c. Collaboration diagram for Railway Reservation machine 28 10. State machine diagram 30 11. State chart diagram for CD player 32 12. Activity diagram introduction 33 13. Activity diagram a. Activity diagram of ATM without swinlanes 35 Kakatiya Institute of Technology and Science Page 1

Upload: neo-nigra

Post on 25-Nov-2014

50 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Uml

Roll No:_____________________ OOAD LAB

INDEX1. Unified modeling language 22. Use case Introduction 83. Use case diagram

a. Use case of ATM machine 10b. Use case of Library management 11c. Use case of Railway Reservation System 12

4. Class introduction 135. Class diagram

a. Class diagram of collage management system 16b. Class diagram of Hospital Management system 17c. Class diagram of Library management system 18

6. Interactive diagram Introduction 197. Interactive diagram

a. Interactive diagram for ATM machine 22b. Interactive diagram for Library Management system 23c. Interactive diagram for Railway Reservation system 24

8. Collaboration introduction 259. Collaboration diagram

a. Collaboration diagram for ATM machine 26b. Collaboration diagram for Library machine 27c. Collaboration diagram for Railway Reservation machine 28

10. State machine diagram 3011. State chart diagram for CD player 3212. Activity diagram introduction 3313. Activity diagram

a. Activity diagram of ATM without swinlanes 35b. Activity diagram of ATM with swinlanes 36

14. Component diagram introduction 3715. Component diagrams

a. Component diagram for ATM System 41b. Component diagram for Hospital Management System 42

16. Deployment diagram 4317. Deployment diagram for ATM system 4418. Forward engineering 4519. Reverse engineering 5420. Case study

a. Bank ATM System 61b. Cellular phone Network 69c. Student course registration system 79d. Hospital Management System 88e. Library Information system 97f. Ticket vending system 107g. Trading system 115

Kakatiya Institute of Technology and Science Page 1

Page 2: Uml

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 Diagramsa) Use case diagramsb) Class diagramsc) Object diagramsd) Component diagramse) Deployment diagrams

2. Dynamic diagramsa) Interaction diagrams

i) Sequence diagramsii) Collaboration diagrams

b) State machine diagramsi) State chart diagramsii) Activity diagrams

Applications of UML:

UML is intended primarily for software intensive systems. It has been used effectively for such domains as

1. Enterprise Information Systems2. Banking and Financial Services3. Telecommunications4. Transportation5. Defense and Aerospace

Kakatiya Institute of Technology and Science Page 2

Page 3: Uml

Roll No:_____________________ OOAD LAB

6. Retail7. Medical Electronics8. Scientific9. Distributed Web-based Services

Basic building blocks of UML:

The building blocks of UML can be categorized as

1. Things2. Relationships and3. Diagrams

Things:-

Things are the most important building blocks of UML. Things can be

a) Structuralb) Behavioralc) Grouping d) 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 nameAttributes

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

Page 4: Uml

Roll No:_____________________ OOAD LAB

3. Collaboration: - It defines interaction between elements.

4. Use case : - They are used to identify different use case components of a particular software project. It is used to model the operation.

5. Component : - 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 –

Kakatiya Institute of Technology and Science Page 4

Page 5: Uml

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 task. message

2. State machine : - It is useful when the states of an object in its life cycle. It defines the sequence 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.

Kakatiya Institute of Technology and Science Page 5

Page 6: Uml

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 exists in case of interfaces.

4. Association : It is a set of links that connects elements of an UML

model. Two types of associations –a) Unidirectionalb) Bidirectionalc)

5. Aggregation : It is a ‘has_a’ relationship. It is of two types as -

a) Simple aggregation

b) Composition aggregation

UML Diagrams: -

Kakatiya Institute of Technology and Science Page 6

Page 7: Uml

Roll No:_____________________ OOAD LAB

1. Class diagram2. Use case diagram3. Interaction diagram

i) Sequence diagramii) Collaboration diagram

4. State machine diagrami) State chart diagramii) Activity diagram

5. Component diagram6. Deployment diagram

2. USE CASE DIAGRAMS

Kakatiya Institute of Technology and Science Page 7

Page 8: Uml

Roll No:_____________________ OOAD LAB

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 exist 3 types of relationships-1. Association2. Dependency 3. Generalization

Use case diagrams can containActors – “things” outside the systemUse cases – system boundaries identifying what the system should do.

Use case diagram can be used during analysis 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.

Actor:-

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

Interacts with or uses the system. Provides input to and receives information from the system. Is external to the system and has no control over the use cases.

Customer (actor)

Actors are discovered by examining,

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.

Kakatiya Institute of Technology and Science Page 8

Page 9: Uml

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 as-

A pattern of behavior the system exhibits. A sequence of related transactions performed by an actor and the

system. Delivering something of value to the actor.

Transfer Funds

Note: Use cases often start with a “verb”.

Use cases provide a means to,

Capture system requirements. Communicate with end users and domain experts. Test the system.

3.1Use Case for ATM Machine

Kakatiya Institute of Technology and Science Page 9

Page 10: Uml

Roll No:_____________________ OOAD LAB

change password

Withdraw money

Check balance

Customer

Take mini statement

Database server

Fig: Use case diagram for ATM System

3.2Class diagram for Library Management System

Kakatiya Institute of Technology and Science Page 10

Page 11: Uml

Roll No:_____________________ OOAD LAB

Student Staff

search books

Issue books

Renew books

Pay fine

Person

Return books

Librarian

Fig: Use case diagram for Library Management System

3.3Class diagram for Railway Reservation System

Kakatiya Institute of Technology and Science Page 11

Page 12: Uml

Roll No:_____________________ OOAD LAB

Checking

Train schedule Berth availability fares

Enquiry

Reservation

Pay money

Issue ticket

Confirmation of ticket

Passenger

Cancellation of ticket

ticket Issuer

Fig: Use case diagram for Railway Reservation System

4.CLASS DIAGRAMS

Kakatiya Institute of Technology and Science Page 12

Page 13: Uml

Roll No:_____________________ OOAD LAB

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 nameAttributes

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.

Cardinality Adornment:- Cardinality specifies how many instances of one class may be associated with single instance of other 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.

Kakatiya Institute of Technology and Science Page 13

Page 14: Uml

Roll No:_____________________ OOAD LAB

Valid Values: Value Description 0..0 zero0..1 zero or one0..n zero or more1..1 one1..n one or moren unlimited number

Interface:-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 of 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.

Unidirectional aggregation Bidirectional aggregation

The diamond end designates the client class.

Kakatiya Institute of Technology and Science Page 14

Client

Supplier A

Suppler B

Page 15: Uml

Roll No:_____________________ OOAD LAB

5.1Class diagram for Collage Management System

Kakatiya Institute of Technology and Science Page 15

Page 16: Uml

Roll No:_____________________ OOAD LAB

T&P section

stud_id : intstud_name : stringBranch : stringcompany name : string

Recruitment()

Subject

id : intname : string

College

name : stringlocation : string

Add student()remove student()add dep()rem dept()add staff()rem staff()

*

1

*

1

student

id : intname : stringBranch : string

Enrollment()Attend classes()Attend Exams()

*

1

*

1

*

*

*

*

** **

Lecturer

name : stringDesignation : stringDept id : int

Teaching()

*1 *1

Non teaching staff

name : stringQualification : string*

1*

1

Library

Book id : int

Issue()renewal()Collect fine()collect books()

*

1

*

1

1

*

1

*

*

*

*

*

*

1

*

1

Department

Dept num : intDept name : stringLocation : string

Add subject()Remove subject()

*

1

*

1

1..*1..*

*

1

*

1

1

1

1

1

Fig: Class diagram for College Management System

5.2Class diagram for Hospital Management System

Kakatiya Institute of Technology and Science Page 16

Page 17: Uml

Roll No:_____________________ OOAD LAB

Other staff

name : stringDesignation : string

Surgeons Physicians Interns In patient Out patient Nurses Lab tehnicians

Patients

Name : stringconsulting doc name : string

Bill payment()

Medical store

medicine name : stringmedicine cost : int

supply medicines()

** **

*

1

*

1Hospital

Name : stringLocation : string

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

*

1

*

1

*

1

*

1

*

1

*

1

Treatment

disease type : stringtreatment : string

** **

Doctors

Name : stringSpecialization : string

perf general checkups()pres medicine()pres tests()perf sugery()

** **

Department

Dept num : intDept name : stringLocation : string

<<>maintain doctor records()

*1

*1

*

1

*

1

*

1

*

1

Fig: Class diagram for Hospital Management System

5.3Class diagram for Library Management System

Kakatiya Institute of Technology and Science Page 17

Page 18: Uml

Roll No:_____________________ OOAD LAB

student Faculty

Library admin

Id : intName : string

Manages library()

Librarian

Id : intName : string

Issue books()renewal()collect fine()collect books()

*

1

*

1

Books

Book id : intTitle : stringAuthor : string

Operation

Book id : int

issue()renewal()return()fine()

*1 *1

User

id : intName : string

Take books()pay fine()return books()

1* 1*

Library

Name : stringLocation : string

Issue cards()maintain book details()

1

1

1

1

*

1

*

1 *

1

*

1

*

1

*

1

Fig: Class diagram for Library Management System

6.INTERACTION DIAGRAMS

Kakatiya Institute of Technology and Science Page 18

Page 19: Uml

Roll No:_____________________ OOAD LAB

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 Diagrams: 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.

Link: 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 icons: 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.

A message icon in a sequence diagram represents exactly one message.

Kakatiya Institute of Technology and Science Page 19

Page 20: Uml

Roll No:_____________________ OOAD LAB

Lifeline: Each object appearing on the sequence 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.

Lifeline

Message or Event: a message is a communication carried between two objects that trigger an event. A message is represented in collaboration and sequence diagrams by a message icon which usually indicates its synchronization.

Synchronization types that are supported.

1. Simple2. Synchronous3. Balking4. Time out5. Asynchronous6. Procedure call7. Return

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.

Kakatiya Institute of Technology and Science Page 20

Page 21: Uml

Roll No:_____________________ OOAD LAB

Tools:

1. Object

2. Object message

3. Message to self

4. Return message

5. Destruction marker

7.1 Sequence diagram for ATM System

Kakatiya Institute of Technology and Science Page 21

Page 22: Uml

Roll No:_____________________ OOAD LAB

UserUser ATMATM Database server

Database server

1: Insert atm card

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

7.2 Sequence diagram for Collage information System

Kakatiya Institute of Technology and Science Page 22

Page 23: Uml

Roll No:_____________________ OOAD LAB

UserUser LibraryLibrary LibrarianLibrarian DatabaseDatabase

1: Search for required book

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

7.3 Sequence diagram for Railway Reservation System

Kakatiya Institute of Technology and Science Page 23

Page 24: Uml

Roll No:_____________________ OOAD LAB

PassengerPassenger Reservation counter

Reservation counter

databasedatabase

1: Enquiry about train

2: Check for availability

3: Available:Yes/No

4: No:End enquiry

5: yes:Tells the details of train

6: Pay money for ticket

7: Issues ticket

8: Updates Database

9: Confirms Reservation

10: Cancellation of ticket

11: Updates database

Fig: Sequence diagram for Railway Reservation System

Kakatiya Institute of Technology and Science Page 24

Page 25: Uml

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

9.1. Collaborative diagram for ATM System

Kakatiya Institute of Technology and Science Page 25

Page 26: Uml

Roll No:_____________________ OOAD LAB

User ATM

Database server

2: Check card16: Do u want to continue transactions?

1: Insert atm card5: Enter pin number

10: Select withdraw option from menu11: Enter with draw amount

17: Close transaction

3: Invalid:Insert card properly4: Valid:Display enter pin number

8: Invalid:Re enter pin number9: Valid:displays Menu

14: Not: Displays menu balance not available15: Available:Transaction performed 6: Check pin number

12: Check for available balance

7: Valid/Invalid13: Available/Not

Fig: Collaboration diagram for ATM System

9.2. Collaborative diagram for Library Management System

Kakatiya Institute of Technology and Science Page 26

Page 27: Uml

Roll No:_____________________ OOAD LAB

User Library

LibrarianDatabas

e

2: Available/not

1: Search for required book3: Available:Takes books

4: Not:Leaves Library

5: Gives ID card for issue of book11: Renewal of books

13: Pays fine16: Returns books

18: Pays fine

8: Invalid:Does not issue9: Valid:Issue Books15: Renews books

6: Checks for validation10: Updates Database

12: Checks fine amount14: Updates database

17: checks fine amount19: Updates database

7: Valid/Not

20: Books added back

Fig: Collaboration diagram for Library management System

9.3. Collaborative diagram for railway Reservation System

Kakatiya Institute of Technology and Science Page 27

Page 28: Uml

Roll No:_____________________ OOAD LAB

database

Passenger Reservation counter

1: Enquiry about train6: Pay money for ticket9: Confirms Reservation10: Cancellation of ticket

4: No:End enquiry5: yes:Tells the details of train

7: Issues ticket

2: Check for availability8: Updates Database11: Updates database3: Available:Yes/No

Fig: collaboration diagram for Railway Reservation System

Kakatiya Institute of Technology and Science Page 28

Page 29: Uml

Roll No:_____________________ OOAD LAB

10.STATE-MACHINE DIAGRAMS

There are two types of state-machine diagrams:1. State chart diagram2. Activity diagram

1. State chart diagram : 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 multiple 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.

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

On entry On exit Do On event

2. Start 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 Page 29

Page 30: Uml

Roll No:_____________________ OOAD LAB

However, multiple transitions may be placed on start state, 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 transition:- 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.

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

Page 31: Uml

Roll No:_____________________ OOAD LAB

Tools:1. State

2. Activity

3. Start state

4. End state

5. State transition

6. Transition to self

7. Horizontal synchronization

8. Vertical synchronization

9. Decision

10. Swimlanes

11.1. State chart diagram for CD Player

Kakatiya Institute of Technology and Science Page 31

Page 32: Uml

Roll No:_____________________ OOAD LAB

power on

open

Insert disk

Select a song

play

Rewind Forward Pause Resume song

Stop

Fig: State chart diagram for CD Player

Kakatiya Institute of Technology and Science Page 32

Page 33: Uml

Roll No:_____________________ OOAD LAB

12.Activity diagram:- 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 states2. 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:- Forking:- 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.

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.

Kakatiya Institute of Technology and Science Page 33

Page 34: Uml

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 34

Page 35: Uml

Roll No:_____________________ OOAD LAB

13.1. Activity diagram for ATM System without swimlanes

Insert card

Enter pin number

Select any transaction

Check pin number.

Perform Transaction

End Transaction

Do u want to continue transactions?

Remove card

Invalid

Valid

No

Yes

Fig: Activity diagram for ATM System without swimlanes

Kakatiya Institute of Technology and Science Page 35

Page 36: Uml

Roll No:_____________________ OOAD LAB

13.2. Activity diagram for ATM System with swimlanes

Insert card

Enter pin number

Select any transaction

Remove card

Verify pin number

Check pin number

Perform Transaction

End Transaction

DO U want to continue Transaction?

Invalid

Valid

No

Yes

Bank systemCustomer

Fig: Activity diagram for ATM System with Swimlanes

14. COMPONENT DIAGRAMS

Kakatiya Institute of Technology and Science Page 36

Page 37: Uml

Roll No:_____________________ OOAD LAB

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 package2. Components3. Interfaces4. Dependency relationship

1. Component 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. Components:- 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

Page 38: Uml

Roll No:_____________________ OOAD LAB

Interface circle attached to the component icon means that the component supports that particular interface. Component stereotypes:- 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 programb) Sub programc) Packagesd) Taskse) 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

Page 39: Uml

Roll No:_____________________ OOAD LAB

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

d) Sub program:- 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

Page 40: Uml

Roll No:_____________________ OOAD LAB

3. Interface:- 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.

4. Dependency relationship:- 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.

Kakatiya Institute of Technology and Science Page 40

Page 41: Uml

Roll No:_____________________ OOAD LAB

15.1. Component Diagram for ATM System

ATM

.exe file

database

ATM Transaction .h file

change pwd Bal enquiry Withdrawl Take mini statement

Fig: Component Diagram for ATM System

Kakatiya Institute of Technology and Science Page 41

Page 42: Uml

Roll No:_____________________ OOAD LAB

15.2. Component diagram for Hospital Management System

Hospital

.exe file

Database

.h fileDoctor Department Patients Medical store

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

Fig: Component diagram for Hospital Management System

16. DEPLOYMENT DIAGRAM

Kakatiya Institute of Technology and Science Page 42

Page 43: Uml

Roll No:_____________________ OOAD LAB

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-to-ground communication. Connections are usually bidirectional. The icon for connection is a straight line.

17.1. Deployment diagram for ATM System

Kakatiya Institute of Technology and Science Page 43

Page 44: Uml

Roll No:_____________________ OOAD LAB

ServerATM Machine

Modem

ATM card

Fig: Deployment diagram for ATM System

Kakatiya Institute of Technology and Science Page 44

Page 45: Uml

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 generation3. Again select class diagram, goto Tools->C++->Browser Header

Example-18.1:-

Student

Rollno : intName : 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;

void Enrollment ();

Kakatiya Institute of Technology and Science Page 45

Page 46: Uml

Roll No:_____________________ OOAD LAB

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

Example 18.2 :- Generalization

Kakatiya Institute of Technology and Science Page 46

Page 47: Uml

Roll No:_____________________ OOAD LAB

Non Teaching Staff

Cleaning()Incharge()

Teaching Staff

Teaching()

Staff

Id : intName : char[10]Subject : char[10]Dept Id : int

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);

private int Id; char Name[10];

Kakatiya Institute of Technology and Science Page 47

Page 48: Uml

Roll No:_____________________ OOAD LAB

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

Teaching Staff.h

#ifndef Teaching_Staff_h#define Teaching_Staff_h 1

#include " Staff.h"

class Teaching_Staff : public Staff { public: Teaching_Staff();

Teaching_Staff(const Teaching_Staff &right);

~Teaching_Staff();

Kakatiya Institute of Technology and Science Page 48

Page 49: Uml

Roll No:_____________________ OOAD LAB

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();

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

Example 18.3: Aggregation:

Kakatiya Institute of Technology and Science Page 49

Page 50: Uml

Engine

Brand name : char[10]

Runs car()

Car

Brand name : char[20]Num plate : char[10]Insurance num : int

WheelsRadius : int

Rotates()

Roll No:_____________________ OOAD LAB

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;

const Engine get_the_Engine () const; void set_the_Engine (Engine value);

Kakatiya Institute of Technology and Science Page 50

Page 51: Uml

Roll No:_____________________ OOAD LAB

const Wheels get_the_Wheels () const; void set_the_Wheels (Wheels value);

protected: private:

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_Insurance_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;}

inline void Car::set_Insurance_num (int value){ Insurance_num = value;

Kakatiya Institute of Technology and Science Page 51

Page 52: Uml

Roll No:_____________________ OOAD LAB

}

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

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);

protected: private:

Kakatiya Institute of Technology and Science Page 52

Page 53: Uml

Roll No:_____________________ OOAD LAB

const char* get_Brand_name () const; void set_Brand_name (char* value); private: char Brand_name[10];

Car *the_Car;};

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);

int operator==(const Wheels &right) const;

Kakatiya Institute of Technology and Science Page 53

Page 54: Uml

Roll No:_____________________ OOAD LAB

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

19. REVERSE ENGINEERING

Kakatiya Institute of Technology and Science Page 54

Page 55: Uml

Roll No:_____________________ OOAD LAB

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 engineering3. 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 55

Page 56: Uml

Roll No:_____________________ OOAD LAB

Perform 4 steps given in procedure

Then, we get output as-

employee

id : intname : char [20]

Getdata()

Example 2:- Generalization

Class staff

{

Private:

Int id;

Name:char[20];

Public:

getdata();

};

Class tstaff:public staff

{

Private:

Int x;

Public:

Kakatiya Institute of Technology and Science Page 56

Page 57: Uml

Roll No:_____________________ OOAD LAB

Putdata();

};

Class ntstaff:public staff

{

Private:

Int y;

Public:

Display();

};

Perform 4 steps given in procedure

Then, we get output as-

Output:-

tstaff

x : int

Putdata()

staff

id : intname : char [20]

getdata()

ntstaff

y : int

Display()

Example3 :- Aggregation

Kakatiya Institute of Technology and Science Page 57

Page 58: Uml

Roll No:_____________________ OOAD LAB

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

{

Private :int Radius();

Kakatiya Institute of Technology and Science Page 58

Page 59: Uml

Roll No:_____________________ OOAD LAB

Public : Void Rotates();

};

Perform Above given 4 steps,

Then we get,

Output:

Engine

br_type : char [10]

runs_car()

Wheel

Radius : int

Rotates()

car

brand_name : char [20]num_plate : char [10]ins_num : intD : Door

11

+E

1

1

+W

11

1

1

Kakatiya Institute of Technology and Science Page 59

Page 60: Uml

Roll No:_____________________ OOAD LAB

CASE-STUDY

CASE STUDY: BANK ATM SYSTEM

Kakatiya Institute of Technology and Science Page 60

Page 61: Uml

Roll No:_____________________ OOAD LAB

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 RequirementsThe 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 RequirementThe 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

Page 62: Uml

Roll No:_____________________ OOAD LAB

Usecase Diagram For Bank ATM System

Customer

System startup

System shutdown

Operator

Withdrawl Deposit Transfer Enquiry

Session

Invalid Pin

BankTransaction

<<include>><<extend>>

Class Diagram For Bank ATM System

Kakatiya Institute of Technology and Science Page 62

Page 63: Uml

Roll No:_____________________ OOAD LAB

BankcustomersACustomers

Bank()readCustomers()addCustomers()findCustomer()

CustomerCheckingAccountSavingsAccountcustomerNumberpinaccounts

Coustomer()match()getAccount()

ATMStateCustomerNumberCurrent CustomerAccountBankStart StatePin StateAccount StateTransact State

ATM()setCustomerNumber()selectCustomer()selectAccount()Withdraw()Deposit()setState()

BankAccountBalance

BankAccount()deposit()withdraw()getAccount()

0..*0..*

ATM Simulation

Sequence Diagram For Bank ATM System

Kakatiya Institute of Technology and Science Page 63

Page 64: Uml

Roll No:_____________________ OOAD LAB

: User

: User

Atm Interface

Atm Interface

DatabaseDatabase

Insert Card

Enter Pin

Validate Pin

Validate Ok

Show Options

Choose Option

Select Withdrawl

Enter Amount

Check Balance

Validate Ok

Receive Cash

Remaining balance

Balance Slip

Kakatiya Institute of Technology and Science Page 64

Page 65: Uml

Roll No:_____________________ OOAD LAB

Collaboration Diagram For Bank ATM System

: User

Atm Interface

Database

1: Insert Card2: Enter Pin 3: Validate Pin

4: Validate Ok

5: Show Options

6: Choose Option

7: Select Withdrawl8: Enter Amount

9: Check Balance

10: Validate Ok

11: Receive Cash

12: Remaining balance

13: Balance Slip

Activity Diagram For Bank ATM System

Kakatiya Institute of Technology and Science Page 65

Page 66: Uml

Roll No:_____________________ OOAD LAB

enter pin

perform transaction

collect card

select transaction

insert card

invalid

valid

no more transactions

more trasactions

Kakatiya Institute of Technology and Science Page 66

Page 67: Uml

Roll No:_____________________ OOAD LAB

Component Diagram For Bank ATM System

Atm database

header files

Atm executable files

atm_files

withdrawal balance mini statement

atm _main

change pin

Deployment Diagram For Bank ATM System

Kakatiya Institute of Technology and Science Page 67

Page 68: Uml

Roll No:_____________________ OOAD LAB

Bank Database

ATM Machine

Customer Console

Card Reader

WebPage

Client Desktop

Employee Console

Client Desktop providing services at desks

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

Webpage providing services of online transaction

Card Reader providing services of credit,debit transaction

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

ATM Machine providing services of ATM transaction

Bank Database keeping the details of each and every account

CASE STUDY:CELLULAR PHONE NETWORK

Problem Statement:

Kakatiya Institute of Technology and Science Page 68

Page 69: Uml

Roll No:_____________________ OOAD LAB

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 network’s 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. Calls 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.

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 Conference call if he need and the cellular network identifies it.

Kakatiya Institute of Technology and Science Page 69

Page 70: Uml

Roll No:_____________________ OOAD LAB

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.

Use Case Diagram For Cellular Phone Network

Kakatiya Institute of Technology and Science Page 70

Page 71: Uml

Roll No:_____________________ OOAD LAB

Place conference call

Use scheduler

Place Phone call

<<extend>>

Cellular network

User

Receive phone call Receive additional call

<<extend>>

Class Diagram For Cellular Phone Network

Kakatiya Institute of Technology and Science Page 71

Page 72: Uml

Roll No:_____________________ OOAD LAB

Dialler

Digit()Send()

Dialler Display

DisplayDigit()

Display

Speaker

Emit tone()

Button

CRDisplay

Cellular Radio

Connect()

Sequence Diagram For Cellular Phone Network

Kakatiya Institute of Technology and Science Page 72

Page 73: Uml

Roll No:_____________________ OOAD LAB

:Dialer:DialerSend:ButtonSend:Button :Send Button Aadapter

:Send Button Aadapter

:Cellular Radio

:Cellular Radio

DispayCRDisplay

DispayCRDisplay

1: Buttonpressed()

2: Send()

3: Connection(pno)

4: Inuse()

Collaboration Diagram For Cellular Phone Network

Kakatiya Institute of Technology and Science Page 73

Page 74: Uml

Roll No:_____________________ OOAD LAB

Send:Button :Send Button Aadapter

:Dialer

:Cellular Radio

DispayCRDisplay

1: Buttonpressed()2: Send()

3: Connection(pno)

4: Inuse()

Activity Diagram For Cellular Phone Network

Kakatiya Institute of Technology and Science Page 74

Page 75: Uml

Roll No:_____________________ OOAD LAB

Indicate no balance

Process the dial

Give busy indication

Busy Ringingtone

No response till t sec

Increment the usage time Add Update the balance

Response

Cut the service

Balance out

Have balance

Balance Out

Before 1 min

After Completion

State Chart Diagram For Cellular Phone Network

Kakatiya Institute of Technology and Science Page 75

Page 76: Uml

Roll No:_____________________ OOAD LAB

idle

Ready to dial

Off-hook

Connecting Destination Alerted

Ringing

Talk

Busy Busy

Dial

On-hookOn-hook

Time-out

Component Diagram For Cellular Phone Network

Kakatiya Institute of Technology and Science Page 76

Page 77: Uml

Roll No:_____________________ OOAD LAB

User

Cellular Executable

Network Database

Cellular Network Main

Network

Make Call Receive Call Use Scheduler Place Phone CallReceive phone Call

Deployment Diagram For Cellular Phone Network

Kakatiya Institute of Technology and Science Page 77

Page 78: Uml

Roll No:_____________________ OOAD LAB

Cell Phone Window Mobile

Phone

Central Server

Control console{0...*}

GPS Controller

Tablet PC{0...*}

Fixed Installation

GPS Locator {0...*}

CASE STUDY: STUDENT COURSE REGISTRATION SYSTEM

Problem Statement:

Kakatiya Institute of Technology and Science Page 78

Page 79: Uml

Roll No:_____________________ OOAD LAB

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.

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:

Kakatiya Institute of Technology and Science Page 79

Page 80: Uml

Roll No:_____________________ OOAD LAB

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.

UseCase Diagram for Student Course Registration System

Kakatiya Institute of Technology and Science Page 80

Page 81: Uml

Roll No:_____________________ OOAD LAB

maintain staff inforamation

maintain currirculum

maintain student information

registrar

student

register for a programmer

write examination

pay fee

Class diagram For Student Course Registration System

Kakatiya Institute of Technology and Science Page 81

Page 82: Uml

Roll No:_____________________ OOAD LAB

studentsttudent name : char[20]studentid : int

universityname : char[20]location : char[20]

1..*

11

1..*

programmeprogrmname : char[20]

1..*

1..*

1..*

attend

member

departmentdeptno : intdepname : char[20]

has a

1..*

1..*

1..*

1..*

provide staffstaffname : char[20]staffid : int

1..*

1

1..*

1

assigned to

1..*

1..*

1..*

1..*teach

1

1..*

1

head of1..*

Sequence diagram For Student Course Registration System

Kakatiya Institute of Technology and Science Page 82

Page 83: Uml

Roll No:_____________________ OOAD LAB

studentstudent applicationapplication inteviewinteview admissionadmission

1: send

2: attend

3: [pass]admit

Collaboration diagram For Student Course Registration System

Kakatiya Institute of Technology and Science Page 83

Page 84: Uml

Roll No:_____________________ OOAD LAB

student application

inteview admission

1: send

2: attend

3: [pass]admit

State chart diagram For Student Course Registration System

Kakatiya Institute of Technology and Science Page 84

Page 85: Uml

Roll No:_____________________ OOAD LAB

canceled

do/ notify registerd students

intialization

do/ intialize batch

open

entry/ register studentexit/ increment student

close

do/ finalize batch

cancelcancel

cancel

add student/ set c=0

addstudent[c<n]

[c=n]

start

end

Component diagram For Student Course Registration System

Kakatiya Institute of Technology and Science Page 85

Page 86: Uml

Roll No:_____________________ OOAD LAB

registration executable

database

registration main

student

application interview admission

courses

Deployment Diagram for Student Course Registration System

Kakatiya Institute of Technology and Science Page 86

Page 87: Uml

Roll No:_____________________ OOAD LAB

CASE STUDY : HOSPITAL MANAGEMENT SYSTEM

Kakatiya Institute of Technology and Science Page 87

Page 88: Uml

Roll No:_____________________ OOAD LAB

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 undergoes the various operations by

diagnosing the patients.

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.

Kakatiya Institute of Technology and Science Page 88

Page 89: Uml

Roll No:_____________________ OOAD LAB

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.

Use Case for Hospital Management System

Kakatiya Institute of Technology and Science Page 89

Page 90: Uml

Roll No:_____________________ OOAD LAB

doctor

checking

operations

prescription

patient

receptionist

Class Diagram For Hospital Management System

Kakatiya Institute of Technology and Science Page 90

Page 91: Uml

Roll No:_____________________ OOAD LAB

ambulance

nursesname : char[20]

workersname : char[20]

staffname : char[20]

is a is a

wardsname : char[20]

medical shop

hospitalname : char[20]

has a

has a

has a

has a

doctorname : char[20]

is a

patientsname : char[20]

Goes to

Treatment

Sequence Diagram For Hospital Management System

Kakatiya Institute of Technology and Science Page 91

Page 92: Uml

Roll No:_____________________ OOAD LAB

Doctor Doctor PatientPatient interface receptionist diagnostic

interface receptionist diagnostic

1: Patients name,age

2: Collect fees

3: Checks patients

4: Perform some op

5: Gets Report

6: Gives prescription

Collaboration Diagram For Hospital Management System

Kakatiya Institute of Technology and Science Page 92

Patient Doctor

Page 93: Uml

Roll No:_____________________ OOAD LAB

Doctor Patient

interface receptionist diagnostic

3: Checks patients4: perform some op6: Gives Prescript

1: Patients name,age

2: Collect fees5: Gets Report

Activity Diagram For Hospital Management System

Kakatiya Institute of Technology and Science Page 93

Page 94: Uml

Roll No:_____________________ OOAD LAB

Doctor

perform operation

check patient

Prescription

Prescription

NO

yes

Component Diagram For Hospital Management System

Kakatiya Institute of Technology and Science Page 94

Page 95: Uml

Roll No:_____________________ OOAD LAB

Hospital Header files

Hospital Main

Doctor

Department PatientReceptionist

Diagnosis

data base

Name Id Chief doctor Name Age Appointment

Patient Records

Result

Hospital Executable File Testing

Specification

Deployment Diagram for Hospital Management System

Kakatiya Institute of Technology and Science Page 95

Page 96: Uml

Roll No:_____________________ OOAD LAB

Disease UNT Server

Receptionist PC

articfactUser Friendly Screens

artifactContains Information about

CASE STUDY: LIBRARY INFORMATION SYSTEM

Kakatiya Institute of Technology and Science Page 96

Page 97: Uml

Roll No:_____________________ OOAD LAB

Problem Statement:

Problems that are facing by the users while using the current Library system. The current system of the university doesn’t 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.

3. If some one reserves the book, he’s 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.

5. Fines have to be calculated manually.

6. 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 CDROMS.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 15 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.

i)Reservation: A Library member can reserve an article that is not currently available in the library.

Non-Functional Requirements

Kakatiya Institute of Technology and Science Page 97

Page 98: Uml

Roll No:_____________________ OOAD LAB

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.

Usecase Diagram For Library Information System

Kakatiya Institute of Technology and Science Page 98

Page 99: Uml

Roll No:_____________________ OOAD LAB

Article Renewal

Enquiry

MakeReservation

Member

Remove reservation

Lend article

Return of article

Librarian

Class diagram For Library Information System

Kakatiya Institute of Technology and Science Page 99

Page 100: Uml

Article

articleidavailabilityissuedatereturndate

newarticle()removearticle()lendarticle()returnarticle()renewal()

Fineamount

fineamtpaiddate

payfine()receipt()collection()

0..*0..*Updates

Title

Titleidtypecopiespriceauthorpublicationseditionreservedcopiesissuedcopies

newtitle()removetitle()addnalpurchase()

0..*0..*

copy of

Member

memberidnameaddressborrowinglimit

newmember()removemember()

0..*0..* Utilizes

0..*0..*Pay

0..* reserves

Roll No:_____________________ OOAD LAB

Sequence Diagram For Library Information System

Kakatiya Institute of Technology and Science Page 100

Page 101: Uml

Roll No:_____________________ OOAD LAB

: Librarian : Librarian

Front Panel:Lend...

Front Panel:Lend...

:Title:Title :Article:Article :Member:Member

1: Lending details(Title,Member)

2: Validate:Find Borrowing Limit

3: Borrow limit ok

4: Find availability

5: Available OK

6: Update issue details

7: Update available copy

8: Update book borrowed

9: Close

Collaboration Diagram For Library Information System

Kakatiya Institute of Technology and Science Page 101

Page 102: Uml

Roll No:_____________________ OOAD LAB

Front Panel:Lending Window

: Librarian

:Title

:Article :Member

1: Lending details(Title,Member)9: Close

2: Validate:Find Borrowing Limit

8: Update book borrowed3: Borrow limit ok

4: Find availability7: Update available copy

5: Available OK

6: Update issue details

State Chart Diagram For Library Information System

Kakatiya Institute of Technology and Science Page 102

Page 103: Uml

Roll No:_____________________ OOAD LAB

Title reservation/reserved copies++

Not reserved

entry/ reservation:=0

Reserved

Reservation removed / reserved copies--

Activity Diagram For Library Information System

Kakatiya Institute of Technology and Science Page 103

Page 104: Uml

Acquire title,member information

Issue article

available

Reserve article add one with titles reserved

not available

IF

start

end

Roll No:_____________________ OOAD LAB

Component Diagram For Library Information System

Kakatiya Institute of Technology and Science Page 104

Page 105: Uml

Roll No:_____________________ OOAD LAB

Make reservation

Library executable

Library database

Library main

Librarian

EnquiryArticle renewal

Member

Remove Reservation Return Article

Deployment Diagram For Library Information System

Kakatiya Institute of Technology and Science Page 105

Page 106: Uml

Roll No:_____________________ OOAD LAB

Node1: Library Information Server

Node 2: Counter PC

CASE STUDY:TICKET VENDING SYSTEM

Kakatiya Institute of Technology and Science Page 106

Page 107: Uml

Roll No:_____________________ OOAD LAB

Problem Statement:

A Ticket Vending System(TVM) dispenses tickets to passengers at a railway

station.Passengers use the front panel to specify their Boarding 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

Page 108: Uml

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

Page 109: Uml

Roll No:_____________________ OOAD LAB

Usecase Diagram For Ticket Vending System

specific ticket details

Buy ticket

Passenger

Get cash Details

Withdraw cash

Deposit Cash

Summary report

Operator

check master files

System Administrators

Update master files

Kakatiya Institute of Technology and Science Page 109

Page 110: Uml

Roll No:_____________________ OOAD LAB

Class Diagram For Ticket Vending System

FrontPanel

Cash

Denomination

Note

Denomination Denomination

Requistionslip

startingplacedestinationplacetraveldatepassenger[5]age[5]remark[5]fare

Summary Receipt DebitNote

Ticket

Printer

Report

Kakatiya Institute of Technology and Science Page 110

Page 111: Uml

Roll No:_____________________ OOAD LAB

Sequence Diagram For Ticket Vending System

Passenger : PPassenger : P Front PanelFront Panel

Ticket transacter

Ticket transacter

Requisitionslip

Requisitionslip

Farecalculator

Farecalculator

1: Ticket Request

2: Generate Request

3: PrepareSlip

4: Get Fare

5: Fare

6: Fare7: Fare

8: Indicate Fare

Kakatiya Institute of Technology and Science Page 111

Page 112: Uml

Roll No:_____________________ OOAD LAB

Collaboration Diagram For Ticket Vending System

Passenger : P

Front Panel

Ticket transacter

Requisitionslip

Farecalculator

1: Ticket Request

8: Indicate Fare

2: Generate Request

7: Fare

3: PrepareSlip

6: Fare

4: Get Fare

5: Fare

Activity Diagram For Ticket Vending System

Kakatiya Institute of Technology and Science Page 112

Page 113: Uml

Roll No:_____________________ OOAD LAB

Start

specify ticket details

Buy Ticket

Get cash details

Pay cash

Check master files

Update master Files

Ticket Available Tickets not available

Component Diagram For Ticket Vending System

Kakatiya Institute of Technology and Science Page 113

Page 114: Uml

Roll No:_____________________ OOAD LAB

Ticket Vending Main

Ticket Vending Executable File

TicketVendingDatabase

Operator Passenger

Buy Ticket Ticket DetailsDeposit Cash Withdraw cash Summary Report

Deployment Diagram For Ticket Vending System

Kakatiya Institute of Technology and Science Page 114

Page 115: Uml

Roll No:_____________________ OOAD LAB

Ticket Vending Main Server

server1 server2server3

CASE STUDY: TRADING SYSTEM

Kakatiya Institute of Technology and Science Page 115

Page 116: Uml

Roll No:_____________________ OOAD LAB

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.

c)System should handle Network and power failure.

Kakatiya Institute of Technology and Science Page 116

Page 117: Uml

Roll No:_____________________ OOAD LAB

d)Software must be efficient to use and provide quick recover from the fault.

Usecase Diagram For Trading System

Kakatiya Institute of Technology and Science Page 117

Page 118: Uml

Roll No:_____________________ OOAD LAB

Ship partial order

Bill customer

Place order

Track order

Customer

Validate Customer

<<include>>

<<include>>

Ship order

<<include>>

Class Diagram For Trading System

Kakatiya Institute of Technology and Science Page 118

Page 119: Uml

Roll No:_____________________ OOAD LAB

Customernameaddressphone

ProductIdNamePriceLocation

Invoice Transaction Shipment Stock

OrderItemquantity

Places

1..*1 1..*1

Prepare

Process

Sequence Diagram For Trading System

Kakatiya Institute of Technology and Science Page 119

Page 120: Uml

Roll No:_____________________ OOAD LAB

CustomerCustomerOrder takenOrder taken Order

fulfillmentOrder

fulfillmentBilling agentBilling agent

1: Submit Order

2: Place order

3: Trigger bill

4: Acknowledge order

Collaboration Diagram For Trading System

Kakatiya Institute of Technology and Science Page 120

Page 121: Uml

Roll No:_____________________ OOAD LAB

Order taken

Order fulfillment

Billing agent

Customer : Customer

2: Place order

3: Trigger bill

4: Acknowledge order

1: Submit Order

Activity Diagram With SwimLanes options For Trading System

Kakatiya Institute of Technology and Science Page 121

Page 122: Uml

Roll No:_____________________ OOAD LAB

Request Service

Pay

Collect order

Take order

Fill order

Deliver Order

SalesCustomer

Component Diagram For Trading System

Kakatiya Institute of Technology and Science Page 122

Page 123: Uml

Roll No:_____________________ OOAD LAB

Trading System Executable File

Trading Main

Trading Database

Customer Sales Person

Place Order Track Order Bill customerGive Order

Deployment Diagram For Trading System

Kakatiya Institute of Technology and Science Page 123

Page 124: Uml

Roll No:_____________________ OOAD LAB

Purchase

Stock Balance

Reorder Check

Receiver Order

Place order

Kakatiya Institute of Technology and Science Page 124