0% found this document useful (0 votes)
212 views

Object Oriented Analysis

The document discusses object oriented analysis (OOA). OOA identifies real-world objects involved in the system and constructs an ideal model free from implementation details. During OOA, classes are identified which combine data and functions. Classes are categorized as entity, interface, and control classes. Entity classes represent persistent data, interface classes handle interaction, and control classes coordinate other classes. The document provides examples of how these class types can be identified from a library management system use case.

Uploaded by

Ansh Anurag
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
212 views

Object Oriented Analysis

The document discusses object oriented analysis (OOA). OOA identifies real-world objects involved in the system and constructs an ideal model free from implementation details. During OOA, classes are identified which combine data and functions. Classes are categorized as entity, interface, and control classes. Entity classes represent persistent data, interface classes handle interaction, and control classes coordinate other classes. The document provides examples of how these class types can be identified from a library management system use case.

Uploaded by

Ansh Anurag
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 54

Object Oriented Analysis

Object Oriented Analysis


 After requirements have been captured, the analysis of the
identified requirements begins.
 Object oriented analysis identifies and defines the real-world
objects that are involved in interaction with the system.
 Object oriented analysis (OOA) constructs a robust and ideal
model that is free from the details of implementation
environment.

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Object Oriented Analysis
 In OOA phase, the class modeling techniques are used which
combines the data and functions into a class.
 Thus, data and functions are given equal importance.
 The data is known as attributes and functions are called
operations.

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Object Oriented Analysis
 In OOA phase relationship between classes are depicted
through visual diagrams.
 The purpose of such diagrams is:
 To understand, extract and define the customer’s requirements.
 To serve as a basis for development of the software. Based on these
diagrams it would be easier to develop the database schema of the
system and partially identify its operations.

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Identification of Classes
 A class is a collection of objects, with common attributes and
operations. The objects with common attributes and
operations have similar relationship to the class.
 In Rational Unified Process, classes are categorized into three
types: entity class, interface class and control class.
 These three types of classes allow the analyst to separate the
functionality of the system and simplify the identification
process.

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Identification of Classes
Entity Classes
 Entity classes include those classes that are going to persist longer
in to the system.
 These are the classes which have to be stored and maintained for
a longer period, sometimes for the lifetime of the system.

entity class

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Identification of Classes
Entity Classes
 Consider the ‘issue a book’ use case of LMS case study. The purpose
of the use case is to allow the members (student/faculty/employee) to
issue book from the university library.
 The use case requires the information of member, book and
transaction. Hence, we identify three entity classes:
 Member
 Book
 Transaction

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Identification of Classes
Entity Classes
 The instances of entity classes are known as entity objects.
 Entity classes may not be specific to one use case.
 The attributes and operations of an entity class may be identified
by the actor of the use case.
 Entity classes represent the key attributes of system that is to be
developed.

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Identification of Classes
Interface Classes
 Interface classes handle the interaction in the system.
 They provide interface between the actor (human being or
external system) and the system.
 These classes are known as boundary classes.
 These classes are used to model windows, buttons,
communication protocols etc. usually the life of the interface
classes is only as long the use case exists

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Identification of Classes
Interface Classes
 The interaction of actor with each use case scenario is examined
to extract the interface classes.
 The interface classes represent the number of interfaces required
by an actor to interact with all the paths in the use cases.

interface class
Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra
Identification of Classes
Interface Classes
 For example in LMS, in order to issue a book, an interface is
required. The actor library staff interacts with ‘issue a book’ use
case.
 This means the student/faculty/employee must be able to interact
with something to issue a book.
 A class containing all the options to enable the actor ‘library staff’
issue a book will satisfy the given requirement.
 This class is called IssueBookInterface.

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Identification of Classes
Control Classes
 Control classes are responsible for
coordinating and managing entity and
interface classes.
 The functionality that could not be
placed in either of entity and interface
classes may be placed in a control class.

control class
Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra
Identification of Classes
Control Classes
 A control objects (an instance of control class) is created when the
use case starts and it ends when the use case finishes.
 Control classes may be identified from the use cases.
 One control class may be assigned per use case. These classes are
used to manage and coordinate the flow of events needed to
accomplish the functionality of the use case.
 A control class can be added to handle the flow of events for ‘issue
a book’ use case. This class is called IssueBookController.

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Identification of Classes
Control Classes
 A control objects (an instance of control class) is created when the
use case starts and it ends when the use case finishes.
 Control classes may be identified from the use cases.
 One control class may be assigned per use case. These classes are
used to manage and coordinate the flow of events needed to
accomplish the functionality of the use case.
 A control class can be added to handle the flow of events for ‘issue
a book’ use case. This class is called IssueBookController.

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Identification of Classes
Class name Class type Description

Member Entity This class is used to store the information of the


member (student/faculty/employee) in the university.

Book Entity This class is used to store the information of the books
in the university library.
Transaction Entity This class is used to store the information of the books
issued to the members in the library.
IssueBookInterface Interface This class provides interface between actor and the
system.
BarcodeReader Interface This class reads bar code of book and member of the
library.
IssueBookController Control This class manages and controls the operations in the
‘issue book’ use case
Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra
Identification of Classes

Student Faculty Employee Book IssueBook


Member Book Transaction

IssueBookController

Barcodereader IssueBookInterface
Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra
Identification of Classes
 Consider case study of LMS,. Identify entity classes, interface
classes and control classes for ‘return book’ use case.

Member Book Transaction FineStatus

ReturnBookInterface BarcodeReader

ReturnBookController FineCalculator
Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra
Identification of Classes
Class name Class type Description
BarcodeReader Interface This class reads bar code of book and member of
the library.
Member Entity This class is used to store the member of the
library.
Book Entity This class is used to store the information of the
books in the university library.
Transaction Entity This class is used to store the information of the
transactions to the members in the library.

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Identification of Classes
Class name Class type Description
ReturnBookInterface Interface This class provides return book interface to
the actor of the system.
ReturnBookController Control This class manages and controls the
operations in the ‘return book’ use case.
FineCalculator Control This class manages and controls the
operations in the ‘fine calculation’ use case.
Fine Status Entity This class stores the fine amount and the
status of the fine.

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Identification of Relationships
 If we are constructing a college, it will consist of walls, windows, doors, fan, tube light, projector, black board etc. All of these things are related to each other. Walls are
connected to each other.
 Doors are fixed inside the walls to provide way to enter the room for people. Windows are fixed for light or air purpose. Fans and tube lights are fixed on the ceilings of
the wall to provide cooling and reduce darkness.
 These things have different kinds of relationship amongst them.
 Similarly in OOA, the classes can connect to each other having different kind of relationships. These relationships provide collaboration amongst classes.

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Identification of Relationships
 A system consists of classes and objects. The system model depicts the communication amongst classes.
 The instances of a class communicate through sending messages.
 For example, the book is issued after the issue book message is received by the issue book object.
 There are four types of relationships amongst objects: association, aggregation, dependency, and generalization.

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Identification of Relationships
Relationship Description Notation
Association It provides structural connection
between instances of classes.
Aggregation It provides whole-part kind of
relationship between classes.
Composition It provides strong aggregation
between classes.
Dependency It signifies that changes in one
class affect the other class.
Generalization It signifies parent-child
relationship amongst classes.

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Identification of Relationships
Association
 Association is a structural connection between classes. This type
of relationship is mostly bidirectional. In another terms, the
association relationship provides a link between different objects
of the classes in the relationship.
 For example, there is a connection between IssueBookController
class and book class.

IssueBookController Book
Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra
Identification of Relationships
Association names
 An association relationship may be associated with a name. The
name describes the type of relationship between two classes.

manages

IssueBookController Transaction

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Identification of Relationships
Association roles
 An association relationship may be associated with a name. The
name describes the type of relationship between two classes.

+faculty
0..10
1
0..5 +student
0..10 1
1
Transaction Member
+employee

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Identification of Relationships
Aggregation
 Aggregation relationship models whole-part type of relationships.
It means that a class is a part of another class.
 Some operations in whole class may be applied to the other class.
Aggregation represents ‘has-a’ relationship.
 The notation used for aggregation relationship is a line with a
diamond at the end i.e. to the class denoting the whole.

Library Book
Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra
Identification of Relationships
Multiplicity
 Multiplicity represents the number of instances of classes related
to one instance of another class.

0..5 1

Transaction Student

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Identification of Relationships
 Multiplicity can be shown as many (0..*), one or more (1..*),
exactly one (1). Hence multiplicity is denoted as:
 Minimum_value..maximum_value
 Some commonly used multiplicity indicators are given below
 1 One
 0..* many
 1..* one or more
 0..1 zero or one
 3..5 specific range (3, 4 or 5)

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Identification of Relationships
 The relationship can be read in the following ways
 One Transaction object is related to exactly one student.
For example, B101 book is related to student Ram (a
student object).
 One student object may be related to zero to five
Transaction objects. For example, Ram (a student object)
is related to B101, B105, and B111. Since the range of
multiplicity is zero to five, a minimum of zero and
maximum of five books may be issued to a student.

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Identification of Relationships
 Composition relationship represents strong form of whole-part
relationship.
 When two classes are having composition type of relationship, the
part class belongs to only the whole class.
 The notation used for composition relationship is a line with a
filled diamond at the end i.e. to the class denoting the whole

1 1..*
University Department

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Identification of Relationships
Dependency
 The class refereeing another class is represented through
dependency relationship.
 Hence, change in the class being referenced affects the class using
it.
 The dependency relationship is graphically depicted by a directed
dashed line.

Programme
SchoolSchedule

add(prog : Programme)
Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra
Identification of Relationships
Generalization
 Generalization is a relationship between parent class and

the child class. This relationship depicts inheritance


relationships.
 Generalization relation is also known as ‘is-a’
relationship. In this relationship the child inherits all the
properties of its parents but vice versa is not true.

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Identification of Relationships

Member

Student Faculty Employee

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Identification of Relationships
Modeling Relationships
 If there is an association between pairs of classes, association
relationship is used.
 If one object of a class passes messages to other object other than
through parameters of the method, then association relationship is
used.
 If a class is a whole and other classes are its parts, then an
aggregation relationship is modeled. In other words, when a class
is made up of other classes then aggregation type of relationship is
used.

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Identification of Relationships

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Identification of Relationships
 Consider, identify relationships amongst
classes for ‘return book’ use case.

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


BarcodeReader ReturnBookController
1
1..2 1
1 1
1

1 1 +faculty 1
0..10 1
1 1
0..5 +student 1
1
1 1 0..10 +employee1
ReturnBookInterface Book Transaction Member FineCalculator
1
1

0..5 1
0..1

FineStatus
Identifying state and behavior
 Classes encapsulate both attributes and operations that
operate on those attributes into a single unit.
 An attribute of a class represents data definition and is
used to store information by the objects.
 For example, in a member class memberID, name,
dateOfBirth, phone, email, date of validity of
membership etc are the attributes.

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Identifying state and behavior
 An operation must be well defined with a single goal.
For example member class must be able to add,
delete, update and view the details of a member.
 These requirements are represented by four
operations – addMember, updateMember,
deleteMember, viewMember. All the instances of the
class must be able to perform all these four
operations.

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Identifying state and behavior
Attributes
 Attributes can be identified from the use case description.
Basic Flow 1: Add a book
The system requests that the administrator/DEO enter the book information. This
includes:
 Book barcode ID
 Accession number
 Subject descriptor
 ISBN
 Title
 Language
 Author
 Publisher
Once the administrator/DEO provides the requested information, the book is added to the
Object system.
Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra
Identifying state and behavior
Attributes <<entity>>
Book
bookBarcodeID : Integer
accessionNo : Integer
subjectDescriptor : String
ISBN : Long
bookTitle : String
language : String
authorFname : String
authorLname : String
publisher : String
issueStatus : boolean

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Identifying state and behavior
Hence, there are four methods to identify the attributes in a class:
 The information to be stored can be extracted from the use case
description.
 The fields in the user interfaces given in SRS document can be
used to extract the attributes.
 The database schema, if designed, can be used to retrieve the
attributes. The fields in the tables can be directly mapped to
attributes in classes. The attributes in the table can be mapped
directly as attributes in entity classes. These attributes will be
stored in the relational database in future.
 The domain expertise of the analyst can be used to extract the
attributes.

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Identifying state and behavior
Operations
 It is usually difficult to identify the operations that a class
will contain.
 The operations of a class can be identified by the flow of
events given in the use case description.
 The instance of a class can only be modified through the
operations. Interaction diagrams described in chapter 6
can be used to identify the operations.
 However, operations can be also be identified in OOA
phase.

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Identifying state and behavior
Operations
 Everything connected to the class should be placed in it.
The operations that must be included in an entity class
must include:
 Storing, updating and retrieving information
 Behavior that is included in entity class.

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Identifying state and behavior
<<entity>>

Operations Book
bookBarcodeID : Integer
accessionNo : Integer
subjectDescriptor : String
ISBN : Long
bookTitle : String
language : String
authorFname : String
authorLname : String
publisher : String
issueStatus : boolean

addBook()
deleteBook()
updateBook()
viewBook()
Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra
getIssueStatus()
Example: Issue Book in LMS
 The following line specifies that date of issue and date of return
needs to be stored.
 The book is issued for the specified number of days and the
return date of the book is calculated and stamped on the book.
 Operations are identified using messages which are sent across the
instances of the classes. For example, in issue book use case,
barcodeReader object sends following messages to the
IssueBookInterface object:
 Accept book barcode ID

 Accept member barcode ID

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Example: Issue Book in LMS

<<interface>> <<interface>>
BarcodeReader IssueBookInterface
1 1
getBookBarcodeID() acceptBookBarcodeID()
getMemberBarcodeID() acceptMemberBarcodeID()

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Example: Issue Book in LMS
 The complete set of steps are given below
 Barcode reader is associated with interface screen of issue book. The
interface screen accepts the member and book information from the
barcode reader.
 The interface screen sends issue book message to controller and
controller transfers the control to member object in order to validate
whether the account of the member is full or not.
 If the account is not full, then the controller tells book object to update
the status of the book as issued and tells member object to increment
number of issued books.

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Example: Issue Book in LMS
 The complete set of steps are given below
 There are three associations between Member and Transaction classes.
One of these associations specifies that a member who is a student can
get zero to five books issued. The other two associations specify that
member either a faculty or an employee can get zero to ten books
issued.

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Example: Issue Book in LMS

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Example: Issue Book in LMS
 In UML, we design class diagram which depicts the set of
classes (along with their respective attributes and operations)
and their relationships.
 A class diagram helps us to visualize and model the static
aspects of the system.
 The class diagram models the interaction amongst classes in the
system.

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Example 6:
 Consider return book use case, identify attributes and operations
amongst classes.

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra


Moving towards Object Oriented
Design
An analyst must ensure:
 A class satisfies a requirement extracted from use case description.
 A class is as far as possible independent of other classes.
 Relationships between classes are identified carefully.
 The attributes and operations of a class are identified correctly.
 The multiplicity and roles of classes are identified carefully and are
meaningful.
 The class diagram is consistent with the given specification and
readable.

Object Oriented Software Engineering by Yogesh Singh & Ruchika Malhotra

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy