Object Oriented Ananlysis and Design Lab Manual
Object Oriented Ananlysis and Design Lab Manual
DESIGN LAB
Lab Manual
(17F00410)
R17- Regulation
MCA IV SEM
(2020-2021)
Department of MCA
S.V.COLLEGE OF ENGINEERING
(Approved by AICTE, New Delhi & Affiliated to JNTUA, Anantapur)
Opp. LIC Training Center, Karakambadi Road, Tirupati - 517 507, A.P.
SYLLABUS
Course Objectives:
• Practice the notation for representing various UML diagrams
• Analyze and design the problem by representing using UML diagrams
• Become familiar with all phases of OOAD
Course Outcomes:
• Find solutions to the problems using object oriented approach
• Represent using UML notation and interact with the customer to refine the UML diagrams
Description for an ATM System The software to be designed will control a simulated auto-
mated teller machine (ATM) having a magnetic stripe reader for reading an ATM card, a cus -
tomer console (keyboard and display) for interaction with the customer, a slot for depositing
envelopes, a dispenser for cash (in multiples of Rs. 100, Rs. 500 and Rs. 1000), a printer for
printing customer receipts, and a key-operated switch to allow an operator to start or stop the
machine. The ATM will communicate with the bank's computer over an appropriate commu-
nication link. (The software on the latter is not part of the requirements for this problem.)
The ATM will service one customer at a time. A customer will be required to insert an
ATM card and enter a personal identification number (PIN) - both of which will be sent to
the bank for validation as part of each transaction. The customer will then be able to perform
one or more transactions. The card will be retained in the machine until the customer indi -
cates that he/she desires no further transactions, at which point it will be returned - except as
noted below.
The ATM must be able to provide the following services to the customer:
1. A customer must be able to make a cash withdrawal from any suitable account linked to
the card, in multiples of Rs. 100 or Rs. 500 or Rs. 1000. Approval must be obtained from the
bank before cash is dispensed.
2. A customer must be able to make a deposit to any account linked to the card, consisting of
cash and/or checks in an envelope. The customer will enter the amount of the deposit into the
ATM, subject to manual verification when the envelope is removed from the machine by an
operator. Approval must be obtained from the bank before physically accepting the envelope.
3. A customer must be able to make a transfer of money between any two accounts linked to
the card.
4. A customer must be able to make a balance inquiry of any account linked to the card. 5. A
customer must be able to abort a transaction in progress by pressing the Cancel key instead of
responding to a request from the machine.
The ATM will communicate each transaction to the bank and obtain verification that
it was allowed by the bank. Ordinarily, a transaction will be considered complete by the bank
once it has been approved. In the case of a deposit, a second message will be sent to the bank
indicating that the customer has deposited the envelope. (If the customer fails to deposit the
envelope within the timeout period, or presses cancel instead, no second message will be sent
to the bank and the deposit will not be credited to the customer.) If the bank determines that
the customer's PIN is invalid, the customer will be required to re-enter the PIN before a trans -
action can proceed. If the customer is unable to successfully enter the PIN after three tries,
the card will be permanently retained by the machine, and the customer will have to contact
the bank to get it back. If a transaction fails for any reason other than an invalid PIN, the
ATM will display an explanation of the problem, and will then ask the customer whether he/
she wants to do another transaction.
The ATM will provide the customer with a printed receipt for each successful transac-
tion The ATM will have a key-operated switch that will allow an operator to start and stop
the servicing of customers. After turning the switch to the "on" position, the operator will be
required to verify and enter the total cash on hand. The machine can only be turned off when
it is not servicing a customer. When the switch is moved to the "off" position, the machine
will shut down, so that the operator may remove deposit envelopes and reload the machine
with cash, blank receipts, etc.
List of Tasks for which students have to design all UML diagrams:
1. Banking system
2. Online bookshop system
3. University Systems
4. Library management system
5. Hospital management system
6. Result processing system
OOAD LAB – INDEX
Experiment Topic to be covered Page No
Use Case Diagram: Use case diagrams describe the functionality of a system and users of the
system. They contain the following elements:
1. Actors , which represent users of a system, including human users and other systems.
2. Use cases , which represent functionality or services provided by a system to users Here, is a use
case diagram for the ATM System.
Sequence Diagram: Sequence diagrams typically show the flow of functionality through a use
case, and consist of the following
components:
Communication/Collaboration Diagrams:-
A Communication or Collaboration diagram, as shown is a directed graph that uses objects and
actors as graph nodes. The focus of the collaboration diagram is on the roles of the objects as they
interact to realize a system function. Directional links are used to indicate communication between
objects. These links are labeled using appropriate messages. Each message is prefixed with a
sequence number indicating the time ordering needed to realize the system function.
Here is an example of the Check Balance communication diagram:
Here is an example of the Deposit Cash communication diagram:
State Diagram:-
State transition diagrams provide a way to model the various states in which an object can exist.
While the class diagram show a static picture of the classes and their relationships, state transition
diagrams model the dynamic behavior of a system in response to external events (stimuli). State
transition diagrams consist of the following:
1. States, which show the possible situations in which an object can find itself
2. Transitions, which show the different events which cause a change in the state of an object.
Here, is an example of the state diagram for the session of ATM.
Activity Diagram:- Activity diagrams describe the activities of a class. They are similar to state
transition diagrams and use similar conventions, but activity diagrams describe the behavior/states
of a class in response to internal processing rather than external events. They contain the following
elements:
1. Swimlanes , which delegate specific actions to objects within an overall activity
2. Action States , which represent uninterruptible actions of entities, or steps in the execution of an
algorithm
3. Action Flows , which represent relationships between the different action states on an entity
4. Object Flows , which represent utilization of objects by action states, or influence of action states
on objects.
Following are the examples of Login, Withdraw Activity Diagrams.
Component diagram:
A component diagram is similar to a class diagram in that it illustrates how items in a given system
relate to each other, but component diagrams show more complex and varied connections that
most class diagrams can.
In the diagram below, each component is enclosed in a small box. The dotted lines with arrows
show how some components are dependent on others. For example, the card reader, web page,
client desktop, and ATM system are all dependent on the bank database. The dotted lines with cir-
cles at the end, known as “lollipop” symbols, indicate a realization relationship.
Deployment diagram:
The UML Deployment Diagram is used for visualization of elements and components of a program,
that exist at the stage of its execution. It contains graphical representations of processors, devices,
processes, and relationships between them. The UML Deployment Diagram allows to determine the
distribution of system components on its physical nodes, to show the physical connections between
all system nodes at the stage of realization, to identify the system bottlenecks and reconfigure its
topology to achieve the required performance.
EXPERIMENT – 2
UML Diagrams for Online Banking System
Class Diagram:
A class diagram models the static view of a system. It comprises of the classes, interfaces, and
collaborations of a system; and the relationships between them.
Relationships
A Bank “has–a” number of Branches − composition, one–to–many
A Branch with role Zonal Head Office supervises other Branches − unary association,
one–to-many
A Branch “has–a” number of accounts − aggregation, one–to–many
From the class Account, two classes have inherited, namely, Savings Account and Current
Account.
A Customer can have one Current Account − association, one–to–one
A Customer can have one Savings Account − association, one–to–one
A Branch “has–a” number of Loans − aggregation, one–to–many
A Customer can take many loans − association, one–to–many
Object Diagram
An object diagram models a group of objects and their links at a point of time. It shows the
instances of the things in a class diagram. Object diagram is the static part of an interaction
diagram.
Example − The following figure shows an object diagram of a portion of the class diagram of the
Banking System.
Use cases
Actors
Relationships like dependency, generalization, and association
Interaction Diagrams
Interaction diagrams depict interactions of objects and their relationships. They also include the
messages passed between them. There are two types of interaction diagrams −
Sequence Diagrams
Collaboration Diagrams
Sequence Diagrams
Sequence diagrams are interaction diagrams that illustrate the ordering of messages according to
time.
Notations − These diagrams are in the form of two-dimensional charts. The objects that initiate the
interaction are placed on the x–axis. The messages that these objects send and receive are placed
along the y–axis, in the order of increasing time from top to bottom.
Sequence Diagram
Collaboration Diagram
Collaboration Diagrams
Collaboration diagrams are interaction diagrams that illustrate the structure of the objects that send
and receive messages.
Notations − In these diagrams, the objects that participate in the interaction are shown using
vertices. The links that connect the objects are used to send and receive messages. The message is
shown as a labeled arrow.
Statechart Diagram
A state–chart diagram shows a state machine that depicts the control flow of an object from one
state to another. A state machine portrays the sequences of states which an object undergoes due to
events and their responses to events.
State–Chart Diagrams comprise of −
State-chart diagrams are used for modeling objects which are reactive in nature.
Activity Diagram:
An activity diagram depicts the flow of activities which are ongoing non-atomic operations in a
state machine. Activities result in actions which are atomic operations.
Activity diagrams comprise of −
Components
Interfaces
Relationships
Packages and Subsystems (optional)
AIM
To develop a project E-Book Management system using Rational Rose Software.
PROBLEM STATEMENT
The website has to be maintained properly since the whole ebook purchase process can be
improved. Ebook management in this project gives the idea about how ebooks are maintained in a
particular concern. The book details which includes the number of books available ,no of pages and
price. Ebook management system the Ebook management in this project is understood by going
through the modules that is being involved.
OBJECTIVE
The main objective of this project is to overcome the work load and time consumption which makes
the maintenance of the ebook in an organization as a tedious process. This project provides
complete information about the details of the ebook to the customers. This project identifies the
amount of book available, Separate modules have been created for purchasing, viewing book
details, and delivery details.The purpose of ebook management system is to store and sell the books
in a website effectively.
Class Diagrams
A class diagram is a diagram that shows a set of classes, interfaces, and collaborations and their
relationships. Graphically, a class diagram is a collection of vertices and arcs.
Common Properties: A class diagram is just a special kind of diagram and shares the same
common properties as do all other diagrams A name and graphical content that are a projection into
a model.
Contents:
Class diagrams commonly contain the following things:
Classes,
Interfaces,
Collaborations,
Dependency,
Generalization and association relationships.
Like all other diagrams, class diagrams may contain notes and constraints. Class diagrams may also
contain packages or subsystems, both of which are used to group elements of your model into larger
chunks.
Common Uses: We use class diagrams to model the static design view of a system. This view
primarily supports the functional requirements of a system - the services the system should provide
to its end users
When we model the static design view of a system, we typically use class diagrams in one of three
ways.
1. To model the vocabulary of a system
2. To model simple collaborations
3. To model a logical database schema
Fig: Class Diagram
USE CASE DIAGRAM
A use case is a methodology used in system analysis to identify, clarify, and organize system
requirements. The use case is made up of a set of possible sequences of interactions between
systems and users in a particular environment and related to a particular goal. It is represented using
ellipse.
Actor is any external entity that makes use of the system being modelled. It is represented using
stick figure.
Fig:Use-case Diagram
SEQUENCE DIAGRAM
A sequence diagram in Unified Modeling Language (UML) is a kind of interaction diagram that
shows how processes operate with one another and in what order. It is a construct of a Message
Sequence Chart. There are two dimensions.
1.Veritcal dimension-represent time.
2.Horizontal dimension-represent different objects.
Fig: Sequence Diagram
The sequence diagram describes the sequence of steps to show
• The Customer enters the Ebook website.
• The list of books available are listed.
• Customer checks the book list.
• Database provides user id and pass.
• Customer selects the book.
• Pay money to the Website.
COLLABORATION DIAGRAM
A collaboration diagram, also called a communication diagram or interaction diagram,. A
sophisticated modeling tool can easily convert a collaboration diagram into a sequence diagram and
the vice versa. A collaboration diagram resembles a flowchart that portrays the roles, functionality
and behavior of individual objects as well as the overall operation of the system in real time.
Fig: Collaboration Diagram
STATE CHART DIAGRAM
The purpose of state chart diagram is to understand the algorithm involved in performing a
method. It is also called as state diagram. A state is represented as a round box, which may
contain one or more compartments. An initial state is represented as small dot. A final state is
represented as circle surrounding a small dot.
ACTIVITY DIAGRAM
Activity diagrams are graphical representations of workflows of stepwise activities and actions
with support for choice, iteration and concurrency. In the Unified Modeling Language, activity
diagrams can be used to describe the business and operational step-by-step workflows of
components in a system. An activity diagram shows the overall flow of control. An activity is
shown as an rounded box containing the name of the operation.
Fig: ACTIVITY DIAGRAM
COMPONENT DIAGRAM
The component diagram's main purpose is to show the structural relationships between the
components of a systems. It is represented by boxed figure. Dependencies are represented by
communication association.
EXPERIMENT – 4
UML Diagrams for Library Management System
AIM
To develop a project in Library Management system using Rational Rose Software.
OBJECTIVE
The main objective of this project is to overcome the work load and time consumption which makes
the maintenance of the Library Management System in an organization.
UML DIAGRAMS:
A Use case diagram explains about the behavior of the system. Here we communicate about the
library Management System. A use case is a methodology used in system analysis to identify,
clarify, and organize system requirements. The use case is made up of a set of possible sequences of
interactions between systems and users in a particular environment and related to a particular goal.
It is represented using ellipse.
Class diagram:
Class diagrams commonly contain the following things:
Classes,
Interfaces,
Collaborations,
Dependency,
Generalization and association relationships.
Like all other diagrams, class diagrams may contain notes and constraints. Class diagrams may also
contain packages or subsystems, both of which are used to group elements of your model into larger
chunks.
Sequence diagram:
A sequence diagram in Unified Modeling Language (UML) is a kind of interaction diagram that
shows how processes operate with one another and in what order. It is a construct of a Message
Sequence Chart.
Collaboration diagram:
The component diagram's main purpose is to show the structural relationships between the
components of a system. It is represented by boxed figure. Dependencies are represented by
communication association.
Deployment diagram:
A deployment diagram in the unified modeling language serves to model the physical deployment
of artifacts on deployment targets. Deployment diagrams show "the allocation of artifacts to nodes
according to the Deployments defined between them. It is represented by 3-dimentional box.
Dependencies are represented by communication association.
EXPERIMENT – 5
Hospital Management System
The hospital has several specialized departments like Cardiology, Gynecologic, Orthopedics,
Pediatrics, ENT etc. OPD is another independent department. A doctor is only associated with one
specialized department at a time though he/she can be a member of the OPD(Outside Patients
Department) department. Each doctor has a visiting time and day in a week. At reception the patient
details are entered and the fees are also taken and the patient is tracked on the basis of the Id
generated.
In routine a patient can visit the doctors either directly selecting a doctor or by getting
admitted to the hospital and then a doctor visits the patients. A doctor can prescribe tests for the
patient to perform. The patient visits the lab to get done the tests prescribed by his/her doctor. The
reports are given to the patient. The payments pertaining to the tests are done at the reception.
Referring the reports, the doctor prescribes the patient medicines or further tests or is asked to get
admitted.
A patient is admitted into a ward of a specialized department (if available) as per the
doctor’s prescription. The number of wards is limited and if there is no vacant ward the admission
of the patient is rescheduled. As per the prescription of the doctor the patient is operated on a
specified date and time as decided by the doctor who is doing the operation. After the completion of
the treatment a patient may get discharged on an advice of a doctor and upon the complete payment
of all due charges at the reception. On payment of full dues the reception generates a discharge
ticketforthepatient.
Collaboration diagrams (known as Communication Diagram in UML 2.x) are used to show how
objects interact to perform the behavior of a particular use case, or a part of a use case. Along with
sequence diagrams, collaboration are used by designers to define and clarify the roles of the objects
that perform a particular flow of events of a use case. They are the primary source of information
used to determining class responsibilities and interfaces.
Collaboration Diagram for Treatment at Hospital:-
Deployment Diagram:
A UML deployment diagram is a diagram that shows the configuration of run time
processing nodes and the components that live on them.Deployment diagrams is a kind of
structure diagram used in modeling the physical aspects of an object-oriented system.
EXPERIMENT – 6
UNIVERSITY MANAGEMENT SYSTEM
UNIVERSITY MANAGEMENT SYSTEM (UMS) deals with the maintenance of university,
college, faculty, student information within the university. UMS is an automation system, which is
used to store the college, faculty, student, courses and information of a college.
Starting from registration of a new student in the college, it maintains all the details
regarding the attendance and marks of the students. The project deals with retrieval of information
through an INTRANET based campus wide portal. It collects related information from all the
departments of an organization and maintains files, which are used to generate reports in various
forms to measure individual and overall performance of the students.
Development process of the system starts with System analysis. System analysis involves
creating a formal model of the problem to be solved by understanding requirements.
UMS (UNIVERSITY MANAGEMENT SYSTEM) makes management to get the most
updated information always by avoiding manual accounting process. This system has the following
functional divisions. University Administrator College Administrator User (Students / Faculties)
University Administrator has the functionality of registering new colleges and courses. College
Administrator has the rights of creating department, allocating courses to departments, creating
faculties, students and allocating subjects to faculties, and modifications in the data entered by the
user can also be done by the college administrator. User of this may be faculty or students. Faculty
has the facility of entering the marks and attendance of the students. Students can check their marks
and attendance but there is no chance of modifications.
Object Diagram: These are the objects are used in the hospital management system to generate the
class diagram.
Behavioral features (operations) define what objects of the class "can do"
• Define the way in which objects may interact.
• Operations are descriptions of behavioral or dynamic features of a class.
USE CASE DIAGRAM:
Use case diagrams are typically develop in early stage of development and people often apply use
case modeling for the following purposes:
• Specify the context of a system
• Capture the requirements of a system
• Validate a systems architecture
• Drive implementation and generate test cases
• Developed by analysts together with domain experts
Fig: Use Case Diagram
Sequence Diagram:
• Model high-level interaction between active objects in a system
• Model the interaction between object instances within a collaboration that realizes a use
case
• Model the interaction between objects within a collaboration that realizes an operation
• Either model generic interactions (showing all possible paths through the interaction) or
specific instances of a interaction (showing just one path through the interaction)
Fig: Sequence Diagram
Collaboration Diagram:
• A Collaboration is a collection of named objects and actors with links connecting them.
They collaborate in performing some task.
• A Collaboration defines a set of participants and relationships that are meaningful for a
given set of purposes.
• A Collaboration between objects working together provides emergent desirable
functionalities in Object-Oriented systems.
Unlike a sequence diagram, a collaboration diagram shows the relationships among the objects.
Sequence diagrams and collaboration diagrams express similar information, but show it in
different ways.
Because of the format of the collaboration diagram, they tend to better suited for analysis
activities (see Activity: Use-Case Analysis). Specifically, they tend to be better suited to
depicting simpler interactions of smaller numbers of objects. However, if the number of objects
and messages grows, the diagram becomes increasingly hard to read. In addition, it is difficult to
show additional descriptive information such as timing, decision points, or other unstructured
information that can be easily added to the notes in a sequence diagram. So, here are some use
cases that we want to create a collaboration diagram for:
Model collaborations between objects or roles that deliver the functionalities of use cases
and operations
Model mechanisms within the architectural design of the system
Capture interactions that show the messages passing between objects and roles within the
collaboration
Model alternative scenarios within use cases or operations that involve the collaboration of
different objects and interactions
Support the identification of objects (hence classes) that participate in use cases
Each message in a collaboration diagram has a sequence number.
Component Diagram:
Component diagrams are integral to building your software system. Drawn out with UML
diagramming software, they help your team understand the structure of existing systems and then
build new ones.
Though component diagrams may seem complex at first glance, they are invaluable when it comes
to building your system. Component diagrams can help your team:
Deployment Diagram:
Component diagrams are used to describe the components and deployment diagrams shows how
they are deployed in hardware. UML is mainly designed to focus on the software artifacts of a
system. However, these two diagrams are special diagrams used to focus on software and hardware
components.
EXPERIMENT – 7
Student Result Management System
Aim: To model the student result management system
Objective:
The main objective of the project is to provide the examination result to the student in a simple
way.
This project is useful for students and institutions for getting the results in simple manner.
By a result analyzer with subject status and marks is an application tool for displaying the results
in secure way.
The system is intended for the student. And the privileges that are provided to student are to read
and execute his/her result by providing user name and password for secure login and in case of
new student the registration is available. And the guest user has the privilege only to read.
UML diagram:
Class Diagram:
A class diagram in the Unified Modeling Language (UML) is a type of static structure diagram that
describes the structure of a system by showing the system's classes, their attributes, operations
(or methods), and the relationships among objects.
The class diagram is the main building block of object-oriented modeling. It is used for general
conceptual modeling of the structure of the application, and for detailed modeling translating the
models into programming code. Class diagrams can also be used for data modeling
Class Diagram describes the structure of a Result Management System classes, their attributes,
operations (or methods), and the relationships among objects. The main classes of the Result
Management System are Student, Class, Subject, Exam, Result, Teacher.
Use case Diagram:
A use case diagram at its simplest is a representation of a user's interaction with the system that
shows the relationship between the user and the different use cases in which the user is involved.
A use case diagram can identify the different types of users of a system and the different use cases
and will often be accompanied by other types of diagrams as well. The use cases are represented
by either circles or ellipses.
Fig: Use Case Diagram
Sequence Diagram:
A sequence diagram shows object interactions arranged in time sequence. It depicts the objects
and classes involved in the scenario and the sequence of messages exchanged between the objects
needed to carry out the functionality of the scenario. Sequence diagrams are typically associated
with use case realizations in the Logical View of the system under development. Sequence
diagrams are sometimes called event diagrams or event scenarios.
A sequence diagram shows, as parallel vertical lines (lifelines), different processes or objects that
live simultaneously, and, as horizontal arrows, the messages exchanged between them, in the
order in which they occur. This allows the specification of simple runtime scenarios in a graphical
manner
Collaboration Diagram:
A Communication diagram models the interactions between objects or parts in terms of sequenced
messages. Communication diagrams represent a combination of information taken from Class,
Sequence, and Use Case Diagrams describing both the static structure and dynamic behavior of a
system.
However, communication diagrams use the free-form arrangement of objects and links as used in
Object diagrams. In order to maintain the ordering of messages in such a free-form diagram,
messages are labeled with a chronological number and placed near the link the message is sent over.
Reading a communication diagram involves starting at message 1.0, and following the messages
from object to object.
Communication diagrams show a lot of the same information as sequence diagrams, but because of
how the information is presented, some of it is easier to find in one diagram than the other.
Communication diagrams show which elements each one interacts with better, but sequence
diagrams show the order in which the interactions take place more clearly.
Activity Diagram:
Activity diagrams are graphical representations of workflows of stepwise activities and actions with
support for choice, iteration and concurrency. In the Unified Modeling Language, activity diagrams
are intended to model both computational and organizational processes (i.e., workflows), as well
as the data flows intersecting with the related activities. Although activity diagrams primarily show
the overall flow of control, they can also include elements showing the flow of data between
activities through one or more data stores.
State chart Diagram:
UML state machine also known as UML state chart, is a significantly enhanced realization of the
mathematical concept of a finite automaton in computer science applications as expressed in the
Unified Modeling Language (UML) notation.
The concepts behind it are about organizing the way a device, computer program, or other (often
technical) process works such that an entity or each of its sub-entities is always in exactly one of a
number of possible states and where there are well-defined conditional transitions between these
states.
Component Diagram:
In Unified Modeling Language (UML), a component diagram depicts how components are wired
together to form larger components or software systems. They are used to illustrate the structure
of arbitrarily complex systems.
A component is something required to execute a stereotype function. Examples of stereotypes in
components include executable, documents, database tables, files, and library files. Components
are wired together by using an assembly connector to connect the required interface of one
component with the provided interface of another component.
Student Faculty
Mark
Database
Deployment Diagram:
A deployment diagram in the Unified Modeling Language models the physical deployment of
artifacts on nodes. To describe a web site, for example, a deployment diagram would show what
hardware components ("nodes") exist (e.g., a web server, an application server, and a database
server), what software components ("artifacts") run on each node (e.g., web application,
database), and how the different pieces are connected (e.g. JDBC, REST, RMI).
The nodes appear as boxes, and the artifacts allocated to each node appear as rectangles within
the boxes. Nodes may have subnodes, which appear as nested boxes. A single node in a
deployment diagram may conceptually represent multiple physical nodes, such as a cluster of
database servers.
Result
Manage
Exam ment
Student Faculty Cell