Title: cs2340: Objects and Design: Some OO History and Object Theory
1cs2340 Objects and Design Some OO History and
Object Theory
2Object Theory
- Read Budd book chapters on-line
- Just using an Object-Oriented language does not
mean you truly think in objects! - Side Note Languages are tools, one is not
better than another in a general sense.
3Sending Flowers (Procedural)
What do I need to do? What data do I need?
Chris
Robin
4Sending Flowers (OO)
Arranger
Goal Send Flowers to Robin
Goal Turn Raw Flowers into an arrangement
Florist
Chris
Goal Create Flowers
Grower
Goal Satisfy Customer
Wholesaler
Goal Provide Fresh Flowers
Robin
DeliveryPerson
Goal Deliver Flowers to Robin
Adapted from Budd
5What characteristics do we see?
6Object-Oriented Mantra
- Objects do the work. The work is done in instance
methods in the appropriate class. Good objects
have clear, cohesive responsibilities and clear
focused interfaces.
- Budd OOP is structured as a community of
interacting agents called objects. Each object
has a role to play. Each object provides a
service or performs an action used by other
members of the community.
7So What is an Object?
8An Organizational Hierarchy
- An application a set of interacting objects
- An object an implementation of one or more
roles - A role a set of related responsibilities
- A responsibility an obligation to perform a
task or know information - A collaboration an interaction of objects or
roles (or both) - A contract an agreement outlining the terms of
a collaboration
9Sending Flowers (OO)
Arranger
Goal Send Flowers to Robin
Goal Turn Raw Flowers into an arrangement
Florist
Chris
Goal Create Flowers
Grower
Goal Satisfy Customer
Wholesaler
Goal Provide Fresh Flowers
Robin
DeliveryPerson
Goal Deliver Flowers to Robin
Adapted from Budd
10Contrasting Object vs. Procedural Thinking
- Design the software for the Mars Rover.
Verb-Oriented vs. Noun-Oriented
11Start of the Story Late 60's and Early 70's
- Windows are made of glass, mice are undesirable
rodents - Good programming Structured programming
- Verb-oriented
- Punch-cards, teletype terminals
12Howd we get from there to here?
- How did we move from structured to
object-oriented? - Key ideas
- Master-drawings in Sketchpad
- Simulation objects in Simula
- Alan Kay and a desire to make software better
- More robust, more maintainable, more scalable
13Birth of Objects, 1 of 2
- Ivan Sutherland's Sketchpad, 1963
14Birth of Objects, 2 of 2
- Simula
- Simulation programming language from Norway, 1966
(Kristen Nygaard Ole-Johan Dahl) - Define an activity which can be instantiated as
processes - Each process has it own data and behavior
- In real world, objects don't mess with each
others' internals directly - (Simulated) Multi-processing
- No Universal Scheduler in the Real World
15Alan Kay
- U. Utah PhD student in 1966
- Read Sketchpad, Ported Simula
- Saw objects as the future of computer science
- His dissertation Flex, an object-oriented
personal computer - A personal computer was a radical idea then
- How radical?
"There is no reason anyone would want a computer
in their home." (Ken Olsen, Digital Equipment
Corp, 1977)
16OO History
- Sketchpad Ivan Sutherland (1963)
- Simula Kristen Nygaard (1967)
- Alan Kay Dynabook (1968)
17OOP Term Review
- Class/Object
- Instance
- Message
- Receiver
- Class Hierarchy
- Inheritance
- Overriding/Overloading
- Polymorphism
- Encapsulation
- Abstraction
- Information Hiding