the object model

17
The Object Model Lecture OO02 Classes as Abstract Data Types Understanding Classes and Objects

Upload: tyrone-todd

Post on 30-Dec-2015

30 views

Category:

Documents


0 download

DESCRIPTION

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. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: The Object Model

The Object Model

Lecture OO02

Classes as Abstract Data Types

Understanding Classes and Objects

Page 2: The Object Model

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

Page 3: The Object Model

Teaching Points

The “Kind-of” Hierarchy What is an object? What is a class? Your first pattern

Page 4: The Object Model

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

Page 5: The Object Model

Decomposition

Things or objects in the problem domain– It is all in the way we think about the

problem

Page 6: The Object Model

Abstractions

Abstract data types Kinds of things Relationships

– inheritance– aggregation– use

Page 7: The Object Model

Hierarchy

Akind of@ hierarchy Apart of@ hierarchy

Page 8: The Object Model
Page 9: The Object Model

Example:

Decomposition of an aircraft as a complex system

Remember information-hiding!

Page 10: The Object Model

The Object Oriented Paradigm

No longer a tree of process invocations Now a network of cooperating objects

Page 11: The Object Model

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

Page 12: The Object Model

What is an Object?

An object has:– State (properties, values)– Behavior (modifiers, iterators, selectors,

constructors, destructors)– Identity (???)

Page 13: The Object Model

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

Page 14: The Object Model

Strengths of this kind of decomposition Expression in vocabulary of the problem

domain Strong information hiding

Page 15: The Object Model

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.

Page 16: The Object Model

Composite Pattern May be used to describe:

• File system• Graphics objects• Aircraft Components• etc.

Leaf

Component

Composite

1

0..*children

0..*

1

Client <<uses>>

Page 17: The Object Model

Teaching Points

The “Kind-of” Hierarchy What is an object? What is a class? Your first pattern