CS 4448 - Spring 1998
Object-Oriented Programming and Design
Lecture 1.2
- What people expect to get out of this class?
Chapter 1 - OO Design
- OO is a new Paradigm in computers instead of imperative
(Pascal,C), functional (FP, Haskell), and logic (Prolog). Sapir and
Whorf mentioned in 1956 that language we speak directly influences the
way we view the world.
- Eskimos Inuit Language and the different types of snow.
- What is OO? X is good, OO is good, ergo, X is OO (Stroustrup
1988). Roger King in 1989 claimed his cat was OO. A cat exhibits
characteristic behavior, responds to messages, is heir to along
tradition of inherited responses, and manages its own quite
independent internal state.
- What is an object? Fig 1.2 - class vs. instance
- OO Data vs Abstract Data Types
- Booch-93 notation with State, Behavior, and Identity Fig 1.3
- Class definition in Fig 1.4 - data, methods, etc..
- Object Model - collection of objects interacting and having
relations. Objects perform computation by communicating with each
other, requesting that other objects perform actions. See Fig 1.6.
- Association - relationship has yet to be determined
- Composition - has-a
- User - use-a
- Inheritance - is-a (parent class - base or superclass, child
class - derived or subclass). Infinite Regression is avoided by
OO/imperative languages by using the imperative language as the base
while pure OO uses "primitive" or "native" operations.
- OO - Modularity, Encapsulation, Abstraction
- Design Hierarchy - Common Characteristics (reduces redevelopment,
testing, validation, and integration time), Data Dependencies through
abstraction, Customization via inheritance. ex:
Flo->Florist->Shopkeeper->Human->Mammal->Animal->Material Object
- Language - Typing - Smalltalk (none) vs. C++
- Distributed - Concurrency, Persistence
- Polymorphic Interface Fig 1.8 - Abstract class and derived concrete class
- Booch-93 notation
- Static and Dynamic Models - Fig 1.17
- Module Diagram - Fig 1.18 - high-level view of system - partitions
system into subsystems with modules.
- Category Diagram Fig 1.19 - high-level organization into
categories with using and global relationship
- Class Diagram - Fig 1.15 - detailed view with relationships between
classes.
- Containment - Fig 1.20 - internal and external types of containment
- Cardinality
- Property - 4 types - A(bstract) class used for derivation but not
instantiation, F(riend) try to avoid since results in coupling and
eliminates modularity , V(irtual) useful for multiple inheritance and
more in C++, S(tatic) useful for efficiency.
- Export Controls - Fig 1.24 - public, protected, private, implementation
- State Transition Diagram - Fig 1.21 - events/conditions/actions
- Interaction Diagram - Fig 1.22 - trace of events/operations
between objects
- Object Diagram - Fig 1.23 - like Interaction Diagram with
additional detail.
- Function Hierarchy - Fig 1.24 - detail of which methods use each other
Adam Jonathan Griff,
computer@griffmonster.com
Copyright © University of Colorado. All rights reserved.
Revised: January 14, 1998