Professional Documents
Culture Documents
Object-Oriented Analysis and Design: Lecture 2: Concepts of Object Orientation
Object-Oriented Analysis and Design: Lecture 2: Concepts of Object Orientation
Key question:
Object Orientation
Encapsulation
Modularity
Abstraction
Hierarchy
Object Oriented Analysis and Design 12
What Is Abstraction?
Student Professor
Improves Resiliency
Object Oriented Analysis and Design 15
Encapsulation Illustrated
Professor Clark Professor Clark
needs to be able
to teach four
classes in the
next semester. Name: J Clark
Employee ID: 567138
HireDate: 07/25/1991
Status: Tenured
Discipline: Finance
SetMaxLoad(4) MaxLoad:4
TakeSabbatical()
Course
Catalog
System
Course Registration
System Student
Management
System
Physical entity
Truck
Conceptual entity
Chemical Process
Software entity
Linked List
Name: J Clark
Employee ID: 567138
HireDate: 07/25/1991
Status: Tenured
Discipline: Finance
MaxLoad: 3
Name: J Clark
Employee ID: 567138
Date Hired: July 25, 1991
Status: Tenured
Discipline: Finance
Maximum Course Load: 3 classes Professor Clark
Named Object
: Professor
Professor J Clark
Unnamed Object
Class
+ attribute
+ operation()
Professor
- name
- employeeID : UniqueID
- hireDate
- status
- discipline
- maxLoad
+ submitFinalGrade()
+ acceptCourseOffering() Professor J Clark
+ setMaxLoad()
+ takeSabbatical()
Student
- name
- address
Attributes - studentID
- dateOfBirth
Student
+ getTuition()
+ addSchedule()
Operations + getSchedule()
+ deleteSchedule()
+ hasPrerequisites()
<<stereotype>> Stereotype
Class
Manufacturer B
Manufacturer A Manufacturer C
OO Principle:
Encapsulation
financialInstrument.getCurrentValue()
Tube
<<interface>>
Shape
Pyramid
+ draw()
+ move()
+ scale()
+ rotate()
Cube
Realization relationship
(stay tuned for realization relationships)
Object Oriented Analysis and Design 35
How Do You Represent an Interface?
Elided/Iconic Tube
Representation
(“lollipop”) Pyramid
Shape
Cube
Canonical Tube
<<interface>>
(Class/Stereotype) Shape
Representation Pyramid
+ draw()
+ move()
+ scale()
+ rotate() Cube
UniversityArtifacts
<<subsystem>>
SubsystemName
Interface1
An executable component
<<EXE>>
Executable
Name
OO Principle: Encapsulation
Object Oriented Analysis and Design 39
Subsystems and Components
Components are the physical realization of
an abstraction in the design
Subsystems can be used to represent the
component in the design
Design Model Implementation Model
<<subsystem>>
Component
Component Name
Component Name
Component
Interface
Interface
<<Entity>> <<Entity>>
Professor + instructor CourseOffering
0..1 0..*
Zero or More *
Whole Part
1 0..1
<<Control>>
RegistrationController
<<Entity>> <<Entity>>
Schedule CourseOffering
Dependency
relationship
Component Client Supplier
Dependency
relationship
Savings Checking
Subclass
(Child)
(Descendents)
Object Oriented Analysis and Design 48
Example: Multiple Inheritance
A class can inherit from several other classes.
FlyingThing Animal
Multiple Inheritance
generalization
Subclass
(Child)
Class
Interface
<<subsystem>>
Subsystem Interface