Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

OOSE BCA SEM IV

Object Oriented Analysis Subject Material


– Unit 4

Contents In this unit:


Structured analysis versus object-oriented analysis
Types of classes and its identification
Identification of relationship: Association, aggregation, multiplicity,
composition, dependency, generalization
Modeling relationships
Identifying state and behavior: attributes and operations

Chapter coverage:

4. Object-Oriented Analysis

Reference Book Singh Y., Malhotra R., Object oriented Software Engineering

Juhi Patel UTU Page 1 of 15


OOSE BCA SEM IV

Object-oriented analysis (OOA)


(OOA) is the process of analysing a task to develop a
conceptual model that can then be used to complete the task.

o OOA identifies and defines the real-world


real world objects that are involved in interaction
with the system.
o OOA is the process of defining the problems in terms of real-world
world objects.
o It gives a high level of understanding of problem solution.
o OOA constructs a robust and ideal model that is free from the details of
implementation environment.

In Structured Analysis,

DFD depicts the


he flow of data through the system.
DFD focus on function rather than data.
Data can be modelled using ER diagram.
Disadvantage of Function-oriented
Function technique(DFD) and data-oriented
oriented technique(ED
diagram) are that
functions are given more importance than data
data and functions are modelled separately.

In OOA,
Class modelling techniques are used which combine the data and functions into a
single class.Thus, data and functions are given equal importance.
The attributes (data) in a class only accessed by the operations( functions) in the
classes which prevent accidental modification of data.
Juhi Patel UTU Page 2 of 15
OOSE BCA SEM IV

Relationships between classes


class are depicted through visual diagram.
Purpose of diagram is
to understand, extract and define customer’s requirements
to serve as a basis for development of the software.

Identification of classes

Class is a collection of objects with common attributes and operations


Class is a template groups attributes and operations together and is used to
create objects.
RUP classifies class into 3 types:
◦ Entity classes
◦ Interface class
◦ Control class
This classification helps to separate the functionality

» Entity class:
o Entity classes include those classes that are going to persist longer into the
system. Also called domain classes.
o Eg. Issue book use case requires information of member, book and
transaction.
o Entity class can be used in many use cases.
o Attributes and operations can be identified using actors.
o Major source of information for entity class is the interface screens in the SRS
document.

» Interface Class:
o Handle interactions in the system.
o Provide number of interface required by the actor to perform a task
o Also known as boundary classes
o Used to model windows , buttons, communication protocols.
o Life is only as long as use case exists

Juhi Patel UTU Page 3 of 15


OOSE BCA SEM IV

» Control class:
o Control classes are responsible for coordinating and managing entity and
interface class.
o The control class is used to put together things so that a use case is completed.
o Control class handle the tasks and sequence of events.

o Control class may be identified from the use cases.


o One control class may be assigned to one use case.
o These classes manage and coordinate the flow of events to accomplish the
functionality of a given use case.
o A control object (an instance of control class ) is created
created when use case starts and it
ends when use case finishes.

Juhi Patel UTU Page 4 of 15


OOSE BCA SEM IV

Properties of control class:


class

Control classes have following properties


They are independent of their surroundings
They are used to control flow of events
The changes required in the control
control class are due to the changes in the entity
classes.
They may not perform in the same manner each time they are executed.

Class name Class Description


type

Member Entity represents the information of the


members(students/faculty/employee) in the university.

Book Entity represent the information of the books in the university library.

Transaction Entity represent the information of the transactions to the members in


the library.

IssueBookInterface Interface provides interface between the actor and the system

BarcodeReader Interface reads barcode of books and members of the library.

IssueBookController Control manages and controls the operations in the ‘issue book’ use case.

Juhi Patel UTU Page 5 of 15


OOSE BCA SEM IV

Identification of relationships

o In OOA, the classes can connect to each other having different kinds of
relationships.
o The instances of a class communicate through sending messages.

o Relationship provides a channel through which instances of classes


communicate with each other.

» Example: An object of student class is related to object of course class.

Association:

o This relationship is bidirectional.


o Association relationship provides a link between different objects of the classes.
o Ex: A Student and a Faculty are having an association
Here in a university there are many departments, students and faculties. Association
is applied between those students and faculties who are not in the same department

Juhi Patel UTU Page 6 of 15


OOSE BCA SEM IV

but they acknowledge(know) each other just because they are a part of the
university.

Student Faculty
Other example is of a company which has employess in various departments they may
not work together or know each other personally but they know each other because they
are in the same company.

Giving names to relationships:


relationships

o The association relationship may be associated with a name.


o The name describes the type of relationship between two classes.
o A role may also be associated with two classes.
o A role describes the function a class plays in a association.
o Example: a member playplay the role of a student, faculty or employee when associated
with transaction.
o Multiplicity is specified.
specified

Aggregation

o The aggregation relationship models the whole-part type of relationship


o It is a specific case of association.
o Aggregation is also called a “Has-a”
“Has a” relationship i.e. When an object ‘has-a’
‘has another
object, then you have got an aggregation between them.

Juhi Patel UTU Page 7 of 15


OOSE BCA SEM IV

Example:

A library is incomplete without books, it is of no use, but a book can exist without a library.

Extra Example

Here, a club will not function without a member, similary car will not function
without person , i.e. without person the car is static .

Composition

Composition relationship represents a strong form of the whole-part


whole relationship.

When two classes are having


having composition type of relationship, the part class belongs
to only the whole class.

It is a strong
trong form of aggregation that implies ownership:

if the whole is removed from the model, so is the part.

Juhi Patel UTU Page 8 of 15


OOSE BCA SEM IV

the whole is responsible for the removal of its parts

Notation used for composition relationship is a line with a filled diamond at the end
i.e to the class denoting the whole.

Here university is an owner of the department. For example UTU has 5 departments
other universities may have more than 5 or less than 5 departments. At any time a
university can add or remove departments according to their needs.

Extra example

Juhi Patel UTU Page 9 of 15


OOSE BCA SEM IV

In this example, a car is static i.e. it does not function without a driver so it an aggregation,
but a car is owner of the engine so it is a composition.

Composition cannot be applied from car and person because car is not owner of a person.

Same is applied for the train.

Dependency

o The class referring another class is represented through dependency relationship.


o The change in the class being referenced affects the class using it.
o Dependency relationship is unidirectional.
o When system is designed, the aim is to minimize dependency relationships amongst
the classes.
o It increases complexity and decreases the maintainability of the system.

o SchoolSchedule class is dependent on Programme class as it has to get details of


program from the program class.

o Generalization

o Generalization uses a “is-a” relationship from a specialization to the generalization


class.

o Support multiple inheritance in which a class has more than one parent class.

o Ex: Consider there exists a class named Person. A student is a person. A faculty is a
person. Therefore here the relationship between student and person, similarly
faculty and person is generalization.

Juhi Patel UTU Page 10 of 15


OOSE BCA SEM IV

Modeling Relationships

To identify structural relationships, following are the steps:

o If there is an association between pairs of classes, the association relationship


is used.

o If one object of a class passes messages to the other object other through
parameters of the method, then the association relationship is used.

o If a class is a whole and other classes are its parts, then an aggregation
relationship is modeled . i.e. when a class is made up of other classes
aggregation is used.

Example

Juhi Patel UTU Page 11 of 15


OOSE BCA SEM IV

Example: Relationship between classes in return book use case.

Juhi Patel UTU Page 12 of 15


OOSE BCA SEM IV

Identifying state and behaviou

o Classes encapsulate both attributes and operations that operate on those attributes ,
into a single unit.

Attributes

o An attributes of a class represents data definitions and used to store information.


o Entity object contain many attributes.
o Attributes can be defined from use case description.
o Entity class contain maximum number of attributes while control class may contain a
very few attributes.

UML representation of entity class Book is

Juhi Patel UTU Page 13 of 15


OOSE BCA SEM IV

• There are four methods to identify attributes in a class


1. The information to be stored can be identified from the use case description.
2. Fields in the user interfaces given in SRS document
3. The database schema
4. Domain expertise of the analyst can be used to extract the attributes.

Operations

The operations can be identified by the flow of events given in the use case
description. Interaction diagrams are used to identify operations.
Operations can also be
b identified in the OOA phase.
These operations may be changed according to the needs in the design phase.

Class diagram

Class diagram can be made as follows:

Juhi Patel UTU Page 14 of 15


OOSE BCA SEM IV

Juhi Patel UTU Page 15 of 15

You might also like