The Object Model
-
Upload
tyrone-todd -
Category
Documents
-
view
25 -
download
0
description
Transcript of The Object Model
The Object Model
Lecture OO02
Classes as Abstract Data Types
Understanding Classes and Objects
References
Ambler, S., The Object Primer, Cambridge Univ. Press, 2001, Chapter 1 & 2.
Booch, G., Object-oriented Analysis and Design, Benjamin Cumings, 1994, Chapter 1.
Gamma, E., et al, Design Patterns, Addison Wesley, 1994, Chapter 1
Teaching Points
The “Kind-of” Hierarchy What is an object? What is a class? Your first pattern
Review
What is an abstract data type? How do multiple architectural views help
to cope with complexity?– A new kind of hierarchy is a new “kind of@
hierarchy
Decomposition
Things or objects in the problem domain– It is all in the way we think about the
problem
Abstractions
Abstract data types Kinds of things Relationships
– inheritance– aggregation– use
Hierarchy
Akind of@ hierarchy Apart of@ hierarchy
Example:
Decomposition of an aircraft as a complex system
Remember information-hiding!
The Object Oriented Paradigm
No longer a tree of process invocations Now a network of cooperating objects
What is an Object?
In-formally– A tangible and/or visible thing– Something that may be apprehended
intellectually– Something toward which thought or action
is directed
What is an Object?
An object has:– State (properties, values)– Behavior (modifiers, iterators, selectors,
constructors, destructors)– Identity (???)
What is a class?
An abstraction or the Aessence@ of an object
represents a set of objects that share a common structure and common behavior (interface)
A kind-of-things A single object is simply an instance of a
class
Strengths of this kind of decomposition Expression in vocabulary of the problem
domain Strong information hiding
What is a Pattern?
“A design pattern describes a commonly-recurring structure of communicating components that solve a general design problem in a particular context.”– Gamma, et al.
Composite Pattern May be used to describe:
• File system• Graphics objects• Aircraft Components• etc.
Leaf
Component
Composite
1
0..*children
0..*
1
Client <<uses>>
Teaching Points
The “Kind-of” Hierarchy What is an object? What is a class? Your first pattern