01 Object Oriented Analysis and Design - Basic Concepts
01 Object Oriented Analysis and Design - Basic Concepts
Object Orientation
Encapsulation
Abstraction
Modularity
Hierarchy
Object Oriented Analysis and Design and UML 11/6/2010
What is Abstraction?
10
Salesperson
Not saying
Which
salesperson
– just a
salesperson
in general!!!
Product
Customer
Manages Complexity
Directions
Pre-heat oven to 350; Put
Object Oriented Analysis
milk, eggs,and Design and UML
and sugar 11/6/2010
in 2 quart mixing bowl...
Encapsulation
22-13
Order Processing
System Order
Fulfillment
Billing
Manages Complexity
Object Oriented Analysis and Design and UML 11/6/2010
Inheritance
15 A mechanism for expressing similarity
between things thus simplifying their
definition.
Inheritance
Person
• looks
• behavior
• attitudes
• etc... Object Oriented Analysis and Design and UML 11/6/2010
Inheritance
22-16
Object
Class
Attribute
Operation
Interface (Polymorphism)
Component
Package
Subsystem
Relationships
Behavior
Identity
Object
Class
Attribute
Operation
Interface (Polymorphism)
Component
Package
Subsystem
Relationships
OO Principle: Abstraction
Object Oriented Analysis and Design and UML 11/6/2010
Representing Classes
24
a + b = 10
Professor
Professor Clark
Professor
Professor Jones
Object Oriented Analysis and Design and UML 11/6/2010
Basic Concepts of Object Orientation
28
Object
Class
Attribute
Operation
Interface (Polymorphism)
Component
Package
Subsystem
Relationships
Object
Class
Attribute
Operation
Interface (Polymorphism)
Component
Package
Subsystem
Relationships
CourseOffering
Class
addStudent
deleteStudent
getStartTime
Operation getEndTime
Object
Class
Attribute
Operation
Interface (Polymorphism)
Component
Package
Subsystem
Relationships
Door
#1
#2
#3
Door Door Door versus
#1 #2 #3
Object Oriented Analysis and Design and UML 11/6/2010
What is Polymorphism?
34
The ability to hide many different implementations
behind a single interface
Manufacturer B
Manufacturer A Manufacturer C
OO Principle:
Encapsulation
Object
Class
Attribute
Operation
Interface (Polymorphism)
Component
Package
Subsystem
Relationships
Object
Class
Attribute
Operation
Interface (Polymorphism)
Component
Package
Subsystem
Relationships
OO Principle:
Package Name Modularity
Uses
Organize the model under development
A unit of configuration management
Object
Class
Attribute
Operation
Interface (Polymorphism)
Component
Package
Subsystem
Relationships
<<subsystem>> Component
Component Name Name
Component Component
Interface Interface
Object
Class
Attribute
Operation
Interface (Polymorphism)
Component
Package
Subsystem
Relationships
Association
Aggregation
Composition
Dependency
Generalization
Realization
Association
Role Names
Class University
Professor
Employee Employer
Student Schedule
Aggregation
Student Schedule
Aggregation
One or more *
2, 4..6
Multiplicity
Navigation
ClientPackage SupplierPackage
Dependency
relationship
Object Oriented Analysis and Design and UML 11/6/2010
Relationships: Generalization
52
Account
balance
name
Superclass number
(parent) Withdraw()
CreateStatement()
Generalization
Relationship
Checking Savings
Descendents
Object Oriented Analysis and Design and UML 11/6/2010
Example: Multiple Inheritance
54
multiple
inheritance
GroundVehicle
owner Person
Superclass weight
(parent) licenseNumber 0..* 1
register( )
generalization
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
Object Oriented Analysis and Design and UML 11/6/2010
Class Diagram for the Sales Example
60
Sale