Object Oriented Analysis
Object Oriented Analysis
entity class
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.
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.
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
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.
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.
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
+faculty
0..10
1
0..5 +student
0..10 1
1
Transaction Member
+employee
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
1 1..*
University Department
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
Member
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.
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
<<interface>> <<interface>>
BarcodeReader IssueBookInterface
1 1
getBookBarcodeID() acceptBookBarcodeID()
getMemberBarcodeID() acceptMemberBarcodeID()