Académique Documents
Professionnel Documents
Culture Documents
2
OBJECT-ORIENTED ANALYSIS AND DESIGN
5
Table 7.1: OOA, OOD and OO implementation
Object-oriented analysis Object-oriented design OO implementation
- Focuses on the - Focuses on the solution - Focuses on object-
application domain for domain oriented
problem analysis programming
- Employs modeling
- Employs modeling tools tools for system and - Employs object-
for understanding the object design oriented
physical scenario programming
- Includes operations
languages for coding
- Includes objects and and attributes
and packaging
their interactions
- Covers nonfunctional
- Includes definitions of
- Mostly covers functional requirements
data and operations
requirements
- Adds implementation-
- Covers functional and
- Adds customer-specific specific details
nonfunctional features
views
- Adds platform-
specific details
6
Benefits of Object-Oriented Development
Accelerates development and maximizes the
productivity.
Easy maintenance and enhancement.
Supports reuse.
Reduces complexity.
Improves quality.
Robustness.
Provides tool support.
Improves team communication.
Security and integrity of data.
7
OBJECT ORIENTED CONCEPTS
OBJECTS
An object is a concrete entity or a thing that exists in the
real world or in an abstract way; for example, files,
employees, trains, television, cash, invoice, component,
node, guidelines, tax, etc.
It can be characterized by definite values and actions.
Each object has its own responsibility. Each object
possesses state, behavior, and identity.
State describes the static structure of an object, which
persists throughout its lifespan.
The static structure is defined by its inherent properties
that an object encompasses at any given point of time.
8
OBJECT ORIENTED CONCEPTS
Object State
An object is defined by its attributes and a set of values.
The values have some type that may change over time.
For example, a person has his name, age, height, weight,
residence, and qualification
Joe : Person
Joe is an object of type Person
Name : string
Age : int
Height : decimal
Weight : decimal
Residence : string
Properties of Person type objects
Qualification : string
9
OBJECT ORIENTED CONCEPTS
Object Behavior
Each object performs certain operations (positive or
negative) depending on its state and values.
It means that each object behaves differently at different
times. Thus, state and its operations together define the
behavior of an object.
Each object in a state has certain role in which it performs
responsibilities.
10
OBJECT ORIENTED CONCEPTS
Object Behavior
The different roles of Joe are illustrated in Figure Given
Below
11
OBJECT ORIENTED CONCEPTS
Object Identity
• Identity helps to uniquely identify an object in the real
world.
• It contains certain values.
12
CLASSES
A class is a set of objects that share a common structure,
common behavior, common relationships with other objects,
interactions, and common semantics.
A class has common attributes and operations.
Attributes are the properties of a class. An attribute is the
data value held by an object of the class.
An operation is a service that can be requested by an object
in a class.
An operation is implemented through methods of
programming languages. Each operation has a name, signature,
and its return type.
A signature specifies the number and type of arguments
required to implement the operation.
13
CLASSES
14
CLASSES
Customer
Class name +Customer Name : String
-Customer ID : Integer Class attributes
#Address : String
-Mobile number : Single
#Register() : int
+Purchase() : float
-Edit() : string
-Delete() : string Class methods
-Close() : int
15
ABSTRACTION
16
ABSTRACTION
Degree
+Name : string
+Completion {Abstract}()
UG PG Research
-UG credits -PG credits -Research credits
+Completion() +Completion() +Completion()
20
INHERITANCE
Computer
+Weaving()
+Knitting()
+Crocheting()
+Knotting()
Man-made fabric
23
POLYMORPHISM
ObjectsAdd
-ParameterList
+getData()
+addData()
24
UNIFIED MODELING LANGUAGE (UML)
25
EVOLUTION OF UML
There are three methods of UML.
The Booch Method: It was developed by Grady Booch.
◦ This approach was excellent for design and implementation of
projects. Booch was a primary player in the development of
object-oriented technique and primarily he was working in Ada
language.
The OMT (Object Modeling Technique): This technique
was explored by J. Rambaugh et al.
◦ This was most suitable for analysis and data intensive
information systems.
The Objectory: This is an object-oriented software
engineering approach and it was developed by Ivar
Jacobson.
◦ This method uses use cases for understanding the behavior of a
system. This method is useful in requirements capturing,
analysis, and high-level designs. 26
OBJECT RELATIONSHIPS
27
LINK AND ASSOICATION
28
LINK AND ASSOICATION
Project status
*
Project ID
Projects
30
AGGREGATION
Window system
1 1 * 0..2 1
31
COMPOSITION
32
COMPOSITION
Course Students
1 *
33
GENERALIZATION
Telephone
Landline Wireless
35
DEPENDENCY
36
DEPENDENCY
37
DEPENDENCY
«uses»
Withdraw
Transaction
money
38
REALIZATION
«implementation class»
Student
sponsored student
40
UML BUILDING BLOCKS
41
USE CASE
43
ACTOR
44
ACTOR
Employee Account
Bank ATM
45
CLASS
A class defines the static structure of an object. It
includes the attributes and the methods of an object.
All objects of a class have the same attributes and
behavior.
All objects can be distinguished with their attributes.
Classes are represented by rectangles which have three
compartments.
The upper part represents the class name; the second part
is used for attributes; and the last part is used for
operation specifications.
Attributes and operations are specified with their data
type. The parameters can be specified in the operations
46
CLASS
Employee Account
-EMP ID : int -Account number : int
-Name : string -Account holder : string
-Address : string -Bank name : string
-Designation : string -Balance : decimal
-Salary : decimal -Account type : string
+getName() : string +createAccount() : int
+getSalary() : decimal +depositMoney() : decimal
+getBonus() : decimal +withdrawMoney() : decimal
+getSeniority() : int +enquiry() : string
47
INTERFACE
An interface defines communication socket to connect
with another class.
It contains a set of operations that a class provides to the
other classes.
Generally, interfaces are implemented through abstract
classes in which services of a class are defined. An interface
does not contain attributes.
In UML an interface is shown as a class with the interface
stereotype written on it.
Sometimes, type stereotype is also used for the
representation of an interface.
It has only the operations that will be implemented by
other classes.
A circle notation is also used to represent the interface
with a solid line to the class that supports it.
In C++, it is specified by pure virtual functions.
48
INTERFACE
For example, RegistrationRecord class can be used by
the RegisterStudent class for registration in the library.
RegistrationRecord is supported by the Library class.
Student registration is possible through this interface
that the library is using for registration.
«interface» Library
RegistrationRecord
+GenerateID() : int
+GetName() : string
+GetAddress() : string
RegistrationRecord
RegisterStudent
RegisterStudent
49
COMPONENT
A component is an independent unit of execution. It is a
piece of software that implements a number of
interfaces.
Components are implementation in the physical
architecture of the concepts that are replaceable in the
system.
A component provides its services to other components.
A component instance has a name and a type.
Components can be programs, DLLs, runtime linkable
images, and so on.
A component is shown as a rectangle with two small
rectangles protruding from its side.
50
COMPONENT
StringHandling stringOperations
51
PACKAGE
A package is used to represent the modular view of a
system.
A package represents the part of a system which contains
several classes and it may in turn also contain other
packages.
Packages are conceptual groupings of the system and
need not necessarily be implemented as cohesive
software modules.
These are used to combine classes, components, nodes,
and other UML constructs. As a package consists of other
constructs, there exist dependencies among them.
A package is drawn as a rectangle with tabs on it.
Dependencies are shown as dashed arrows.
52
PACKAGE
Result
Evaluation
processing
53
NODE
A node is a physical object that can execute artifacts.
It exists at run time and represents computational
resources such as memory and processing units.
Nodes can vary in size and capability, from a simple
embedded device to a server form.
Nodes are used in deployment diagrams. They show
how programs flow during their runtime environment
and at what device program is to be executed.
Nodes are especially identified in the component
development environment such as J2EE, .NET, etc.
A node is shown as a stylized cube with the name of the
node.
54
NODE
Databse server
web server
55
COLLABORATION
Collaboration is the organization of various objects to
realize the behavior in a context.
It also represents the interaction between software objects.
It illustrates messages being sent between classes and
objects (instances).
All the objects and their relations are wired together using
connectors to show the communication flow.
56
COLLABORATION
Temp
Thermoscope Temperature
57
INTERACTION
The purpose of interaction is to show the messages
exchanged among objects.
Each message is exchanged between objects in a specified
context.
Interaction represents the dynamic behavior of the system.
It shows the flow of control across objects.
It is represented by an arrow with the message name
exchanged between the objects and it is shown as follows.
58
INTERACTION EXAMPLE
acknowledge
59
STATE MACHINE
60
STATE MACHINE
switch on
Idle Booting
61
NOTE
It is a note symbol
62
UML DIAGRAMS
Process view
Structural view Sequence diagram
Class diagram Collaboration diagram
Object diagram State diagram
Activity diagram
User's view
Use case diagram
64
4+1 VIEW OF UML DIAGRAMS
65
USE CASE DIAGRAM
“Use case” means what the different “uses” of a system are.
Use case depicts the functions that the system provides the
actors.
The use case diagram shows which actors interact with each use
case.
It is primarily used to capture the user requirements. The user
requirements are represented in an abstract manner without a
description of their details.
The behavior of a system can be observed through objects and
their relationships and interactions.
The use case diagram results into the use case model, which has
actors, use cases, and the communication lines between them,
along with the events that occur.
Use cases are also described with the use case scenarios.
66
USE CASE SCENARIO
«library»
Delete Library catalogue
membership Delete book
Librarian
Check
Request
availability
membership
<<include>>
Enquire book
Return book
69
Scenario 1: Request membership
System: Library management system
Use case name: Request membership Use case number: UC-01
Participating actors: Initiated by the member and the librarian
Description: Request membership process allows a member to get
membership from the librarian
Preconditions: Member should be a member of the organization
Post conditions: Membership form will be completed and verified by the
librarian
Flow of events: 1. Member will request to take membership from the
librarian
2. Librarian will provide the membership form
3. Member will complete the membership form and submit it
to the librarian
Nonfunctional requirements: An understandable membership form should
be designed
Reference documents: Member should be given a departmental membership
manual
70
Scenario 2: Add membership
71
Scenario 3: Delete membership
System: Library management system
Description: Member will request to issue books from the library clerk
75
Scenario 7: Add book
76
Scenario 8: Delete book
77
Example 7.2: Use case for tender management in
EtransQ system
Tender management in EtransQ
* * «extends»
*
Manage tender
Accept tender
* Supplier «uses»
* Publish tender
Fill tender
«extends»
*
Agent
«extends»
Search tender
*
*
Suggest tender
Transporter
78
Example 7.2: Mainline sequence of the
use case scenario
System: EtransQ
Use case name: Tender management Use case number: UC-001
Participating actors: Supplier, agent, and transporter
Description: Tender management feature allows suppliers to post tenders. With this
feature, transporters and agents can sort and search tenders with a single click. Once a
tender is published, its date can be altered.
Preconditions: The user posting the tender should be a supplier.
Post conditions: 1. Notifications are generated for all his associates.
2. Supplier will get an email notification.
Flow of events: 1. Supplier requests to upload the tender.
2. After filling the form, the transporter has to upload a file in
“pdf” format.
3. Once uploaded, the tender will be published on the specified date.
Sub-flow: 1.Search tender.
2. Publish tender.
3. Activate/deactivate tender.
Nonfunctional requirements: There should be the best deal available in the market in case
of a large shipment or have good relations with actors for a
prolonged time.
Reference documents: Tendering manual 79
USE CASE RELATIONSHIP
80
USE CASE RELATIONSHIP
INCLUDES
There may exist commonalities in use cases.
A use case may contain the behavior common to several
use cases.
Use case is included in other use cases.
COMMUNICATES
The communication relationship is used to exchange
information between actors and use cases.
The communication relationship is shown by drawing a line
between use cases and actors.
Administrator
Librarian
82
USE CASE RELATIONSHIP
EXTENDS
Extend relationship is used to extend a use case by adding
events in it.
The extend use case may include the behavior of
extending use case. For example, student evaluation
extends to result preparation and student promotion.
Student evaluation
«extends»
Student
promotion
83
USE CASE RELATIONSHIP
GENERALIZES
It is used to specialize another use case or actor by adding or
removing its behavior.
The child use case or actor inherits the behavior of its parent
use case or actor.
Pay bill
84
CLASS DIAGRAM
85
Figure 7.19: Class diagram for a library
management system
1 Library Catalogue
uses Consists of *
* -Name : string
-Total books : int Entered into
1
* -Created by : string Book
Library employee +AddBook() -Title : string
-Name : string +DeleteBook() -subject : string
-Adrress : string +Display() -Author : string
-LoginInfo : string +updateBook() -ISBN : int
-ContactInfo : string 1 -Copies : int
* +add()
service Library +delete()
+update()
-Name : string
+IsAvailable()
-Location : string 1
+ManageMember()
+ManageBook()
Librarian Library clerk +ManageEMP()
-LibraryID -LibraryID +ManageDatabase()
+ManageLibrary() +IssueBook() Reference book Course book
+Allowmembership() +ReturnBook()
+DeleteMembership() -ReferenceID -IssueID
+AddBook()
Member -DateofReturn
+DeleteBook()
-Name : string
-LibID : void
-Address : string
-DOB : int
-ContactNo : int Employee
Student
+UpdateInfo() -EmpID
-CourseName : string
+TakeMembership() -DeptName
-StudentID : void
+RemoveMembership() +CheckBookDetail()
+CheckBookDetail() +IssueBook()
+ReturnBook()
86
OBJECT DIAGRAM
87
Figure 7.20: Object diagram for a library
management system
CSIT : Library
SE : Book
88
SEQUENCE DIAGRAM
89
SEQUENCE DIAGRAM
A sequence diagram shows the interaction among objects by
passing messages in a time- based sequence.
The diagrammatic representation of a sequence diagram has two
dimensions: vertical dimension and horizontal dimension.
The vertical dimension has vertical dashed lines that participate
in the interaction represent object’s lifeline.
The object’s lifeline states the existence of the object at a
particular point of time.
The messages that they exchange are arranged in time sequence.
Object names are written inside the box at the head of the
vertical lines and these are underlined.
The vertical lines indicate timing that progresses downwards.
The horizontal dimension represents different objects without
any ordering.
90
SEQUENCE DIAGRAM
• A vertical thin rectangle called activation symbol on lifeline shows
the period during which an object is active.
• During the activation period, an object performs an action either
directly or through its subparts.
• The action being performed by the object is labeled in text next to
the activation symbol. Activation can be merged or split into parts.
• Objects communicate through messages passed among them. A
message is shown as a horizontal solid arrow from the lifeline of
one object to the lifeline of another object.
• When an object calls itself, then message arrow may start and
finish on the same object’s lifeline.
• The message arrow is labeled with the message name and its
argument values.
• Sometimes, messages are labeled with sequence number to show
the sequence of the message in the overall interaction.
91
Figure 7.21: Sequence diagram for a library
management system
Member Librarian Library clerk Library catalogue Book Library
Request membership
Assign Library ID
Enquire a book
Search result
92
COLLABORATION DIAGRAM
4. Assi
5.
A d gn
d i Li
n t br a
3. Submit membership form
2. Provide membershipform
he r y
1. Request membership
lib ID
6. Ack with library ID
9. Search result
Library
7. Enquire a book
11. Request for issue
10. Ack bookavailability
12. Issue book
Member Library clerk
94
STATE CHART DIAGRAM
Issue book
Issued
96
ACTIVITY DIAGRAM
An activity diagram also illustrates the dynamic view of a
system.
The activity diagram is basically a kind of state chart
diagram that represents the procedural flow of controls form
one activity to another.
An activity can be described as an operation of the system.
Action states are shown as a rounded rectangle. The
completion of an action state is shown by an arrow.
The branching conditions are shown with a small diamond
box that represents the alternative paths.
The outgoing arrows are labelled with a condition or guard
expression.
The outgoing arrows represent the set of all possible
outcomes.
97
Figure 7.24: Activity diagram for a library
management system
Member Library Library Library
clerk catalogue
Yes
Issue book
No
Message box
98
COMPONENT DIAGRAM
99
Figure 7.25: Component diagram for a
library management system
Library
system
Library
catalogue
User interface
100
DEPLOYMENT DIAGRAM
101
Figure 7.26: Deployment diagram for a
library management system
Library
Library
Management
Management
Source code
Source code
Database server
My SQL
2000
102
OOAD PROCESS
OOA focuses on the problem domain and OOD concentrates on
the solution domain.
OOA and OOD help OOP in implementation of the system.
OOA, OOD, and OOP work together for the development of
software.
The main activities of object-oriented software development are
as follows:
• Project initiation
• Requirement engineering
• System design
• Object design
• Implementation
• Testing
• Deployment 103
OBJECT ORIENTED ANALYSIS AND
DESIGN PROCESS
Development phases OOAD activities
Class diagram
Requirements engineering
Interaction diagram
Subsystem decomposition
System design
Class diagram
Object design specification
Implementation Object-oriented
programming
Installation
Deployment
104
SUMMARY
OOAD is an approach for analysis and design, which
focuses on modeling rather than design.
There are various building blocks of object-oriented
development, such as objects, classes, encapsulation,
abstraction, message passing, inheritance, and
polymorphism.
Unified Modeling Language (UML) is a language for
specifying, visualizing, constructing, and documenting the
artifacts of software systems as well as for business
modeling and other non-software systems.
It combines OOSE, OMT, and the Booch method. UML is
an object- oriented modeling language where the real world
situation is viewed as a set of objects that interacts each
other. 105
SUMMARY
Most commonly used object relationships in object-oriented
modeling language are association, generalization,
aggregation, composition, realization, and dependency.
UML provides nine different diagrams.
The UML diagrams are divided into following 4 + 1
different views, viz., users’ view, structural view, process
view, implementation view, and the deployment aspects.
Object-oriented software development employs OOA,
OOD, and OOP.
Object-oriented software development has several activities
and these are project initiation, requirement engineering,
system design, object design, implementation, testing, and
deployment.
106