ASE - 5-2 Object Oriented Analysis and Design PDF
ASE - 5-2 Object Oriented Analysis and Design PDF
ASE - 5-2 Object Oriented Analysis and Design PDF
BY
DR. L. RANATHUNGA
Additional References
1
1/4/20
What is Object-Oriented?
What is Object-Oriented?
2
1/4/20
Behavioral Models
Characteristics of Objects
Identity
¡ The data is quantized into discrete, distinguishable entities
called objects.
¡ ex : wheel of a bike, paragraph of a text, window on work
station, etc
Classification
¡ The objects with same data structure (attributes) and
behaviors (methods) are grouped into a class.
¡ Ex: Bingo is an object, belongs to dog class and animal super
class (Abstract)
3
1/4/20
Characteristics of Objects
Polymorphism
¡ The same behavior may occur differently in different classes.
¡ ex : move operation on a window is differ from move
operation on file, etc
Inheritance
¡ the sharing of attributes and operations among classes based
on hierarchical relationship.
¡ ex: classes can create sub classes
4
1/4/20
5
1/4/20
Object Orientation
Encapsulation
Abstraction
Modularity
Hierarchy
What is Abstraction?
Salesperson
Not saying
Which
salesperson –
just a
salesperson
in general!!!
Product
Customer
Manages Complexity
6
1/4/20
What is Encapsulation?
Improves flexible
What is Modularity?
Order Processing
System Order
Fulfillment
Billing
Manages Complexity
7
1/4/20
What is Hierarchy?
Object
Class
Attribute
Operation
Interface (Polymorphism)
Component
Package
Subsystem
Relationships
8
1/4/20
What is an Object?
Informally, an object represents an entity, either
physical, conceptual, or software
¡ Physical entity
Truck
¡ Conceptual entity
Chemical Process
¡ Software entity
Linked List
9
1/4/20
Representing Objects
An object is represented as rectangles with
underlined names
: Professor
a + b = 10
ProfessorMala
Class Name Only
Professor Mala
ProfessorMala :
Professor Object Name Only
What is a Class?
10
1/4/20
Sample Class
Class
Course
Properties Behavior
Name Add a student
Location Delete a student
a + b = 10
Days offered Get course time table
Credit hours Determine if it is full
Start time
End time
Representing Classes
a + b = 10
Professor
Professor Mala
11
1/4/20
Class Compartments
Classes of Objects
12
1/4/20
Objects Class
Professor
Professor Seetha
What is an Attribute?
Object
Class
13
1/4/20
What is an Operation?
CourseOffering
Class
addStudent
deleteStudent
getStartTime
Operation getEndTime
What is Polymorphism?
The ability to hide many different implementations
behind a single interface
Manufacturer B
Manufacturer A Manufacturer C
14
1/4/20
What is an Interface?
Realization relationship
Interface Representations
Tube
Iconic
Representation
Pyramid
Shape Cube
Canonical Tube
(Class/Stereotype) <<interface>>
Representation Shape
Pyramid
Draw
Move
Scale
Rotate Cube
15
1/4/20
What is a Component?
What is a Package?
¨ A package is a general purpose mechanism for
organizing elements into groups
¨ A model element which can contain other model
elements
OO Principle:
Package Name Modularity
¨ Uses
¡ Organize the model under development
¡ A unit of configuration management
16
1/4/20
What is a Subsystem?
<<subsystem>> Component
Component Name Name
Component
Component
Interface Interface
17
1/4/20
Relationships
Association
Aggregation
Composition
Dependency
Generalization
Realization
Relationships: Association
Models a semantic connection among classes
Association Name
Association
Role Names
Class University
Professor
Employee Employer
18
1/4/20
Relationships: Aggregation
A special form of association that models a whole-
part relationship between an aggregate (the whole)
and its parts
Whole Part
Student Schedule
Aggregation
Relationships: Composition
Whole Part
Student Schedule
Aggregation
19
1/4/20
Association: Multiplicity
Unspecified
Exactly one
1
Zero or more (many, unlimited)
0..*
*
One or more
1..*
Zero or one
0..1
Specified range
2..4
Multiple, disjoint ranges
2, 4..6
20
1/4/20
Multiplicity
Navigation
Relationships: Dependency
A relationship between two model elements where a
change in one may cause a change in the other
ClientPackage SupplierPackage
Dependency
relationship
21
1/4/20
Relationships: Generalization
Account
balance
name
Superclass number
(parent) Withdraw()
CreateStatement()
Generalization
Relationship
Current Savings
Descendents
22
1/4/20
FlyingThing Animal
multiple
inheritance
23
1/4/20
GroundVehicle
owner Person
Superclass weight
(parent) licenseNumber 0..* 1
register( )
generalization
Relationships: Realization
One classifier serves as the contract that the other
classifier agrees to carry out
Found between:
¡ Interfaces and the classifiers that realize them
Class Component
Subsystem
Interface Interface
Interface
Elided form
¡ Use cases and the collaborations that realize them
Canonical form
24
1/4/20
A single paradigm
Facilitates architectural and code reuse
Models more closely reflect the real world
¡ More accurately describe corporate data and processes
¡ Decomposed based on natural partitioning
¡ Easier to understand and maintain
Stability
¡ A small change in requirements does not mean massive
changes in the system under development
Sale
25
1/4/20
Questions?
Next à UML Notations
26