CS 535: Object-Oriented Programming & Design
Fall Semester, 1997
Intro Lecture
To Lecture Notes Index
San Diego State University -- This page last updated 01-Sep-97
Contents of Intro Lecture
- References
- Introduction
- Methodologies
- Meyer's Criteria for Evaluating for Modularity
- Principles for Software Development
- What is Object-Oriented Programming
- Conceptual Level Definition of OOP
- Stages of Object-Oriented Expertise2
Object-Oriented Software Construction, Bertrand Meyer, Prentice Hall,
1988
Reading
Chapter 5 of The Java Programming Language by Thursday, Sept. 4
Chapter 6 of the Java Programming Language by Tuesday, Sept.
9
History and Languages
1967 Simula
1970 to 1983 Smalltalk
1979 Common LISP Object System
1980 Stroustrup starts on C++
1981 Byte Smalltalk issue
1983 Objective C
1986 C++
1987 Actor, Eiffel
1991 C++ release 3.0
199x Volume of OO books/articles
deforests Oregon
1995 Design Patterns
1996 Java
1983 to 1989 Language books with OO concepts
1989 to 1992 Object-oriented design books
1992 to present Object-oriented methodology books
Other Languages
Java
Self
Python
Perl
Prograph
Modula 3
Oberon
Scheme
Smalltalk Venders
ParcPlace, Digitalk, Quasar, Disney
Prolog++
Ada 95
Object Pascal (Delphi)
Object X, X = fortran, cobal, etc.
Approach to developing software
Methodologies encompass
- Step-by-step methods
- Graphical notation
- Documentation techniques
- Principles, guidelines, policies
Object-Oriented Design (OOD)
- Booch
Object-Oriented Systems Analysis (OOSA)
- Shlaer & Mellor
Object Modeling Technique (OMT)
- Rumbaugh et al.
Object-Oriented Analysis (OOA)
- Coad & Yourdon
Hierarchical Object Oriented Design (HOOD)
- European Space Agency, HOOD Working Group
Responsibility-Driven Design (CRC)
- Wirfs-Brock et al.
Object-Oriented Software Engineering (Objectory)
- Jacobson
Fusion
What is the Big Deal?
Category | # of Programmers | Duration | Size (loc) |
Trivial | 1 | 1-4wks | 500 |
Small | 1 | 1-6mos | 1-2K |
Medium | 2-5 | 1-2yrs | 5-50K |
Large | 5-20 | 2-3yrs | 50-100K |
Very Large | 100-1000 | 4-5yrs | 1M |
Extremely large | 2000-5000 | 5-10yrs | 1-10M |
Need better ways to develop software
Need to develop better software
Decomposability
Decompose problem into smaller subproblems
that can be solved separately
Example: Top-Down Design
Counter-example: Initialization Module
Meyer's Criteria for Evaluating for Modularity
Composability
Freely combine modules to produce new systems
Examples: Math libraries
Unix command & pipes
Meyer's Criteria for Evaluating for Modularity
Understandability
Individual modules understandable by human reader
Counter-example: Sequential Dependencies
Meyer's Criteria for Evaluating for Modularity
Continuity
Small change in specification results in:
Changes in only a few modules
Does not affect the architecture
Example: Symbolic Constants
const MaxSize = 100
Meyer's Criteria for Evaluating for Modularity
Protection
Effects of an abnormal run-time condition is confined to a few modules
Example: Validating input at source
KISS Keep it simple, stupid
Supports:
-
- Understandablity
- Composability
Decomposability
Small is Beautiful
Upper bound for average size of an operation[1]
Language | Lines of Code |
Smalltalk | 8 |
C++ | 24 |
Supports:
- Decomposability
- Composability
- Understandability
Applications of Principles
First program:
class HelloWorldExample
{
public static void main( String args[] )
{
System.out.println( "Hello World" );
}
}
Language Level Definition
Conceptual Level Definition
- Abstraction
- Encapsulation
- Information Hiding
- Hierarchy
Abstraction
"Extracting the essential details about an item or group of items, while
ignoring the unessential details."
Edward Berard
"The process of identifying common patterns that have systematic variations; an
abstraction represents the common pattern and provides a means for specifying
which variation to use."
Richard Gabriel
Example
Pattern: Priority queue
Essential Details: length
items in queue
operations to add/remove/find item
Variation: link list vs. array implementation
stack, queue
Conceptual Level Definition of OOP
Encapsulation
Enclosing all parts of an abstraction within a container
Information Hiding
Hiding parts of the abstraction
Novice
Duration: 3 to 6 months
"Novices spend their time trying to get their function-oriented heads turned
around, so they can see the application object classes. They have a hard time
finding the classes and write a lot of function-oriented code."
Apprentice
Duration: 3 to 6 months
"Apprentices begin to understand what object-orientation really means. They
still prefer to work with others, who help foster an environment of discovery.
Apprentices begin turning out good designs, although not consistently. Gurus
and journeymen still need to keep an eye on apprentices."
Stages of Object-Oriented Expertise
Journeyman
Duration: varies greatly, a least a year
"Journeyman have internalized the OO paradigm and work independently. They can
provide key inputs during the design reviews. They still have mental
roadblocks that may require a guru to break through."
Guru
Duration: lifetime
"For gurus, OO development comes naturally. A guru automatically sees things
in an OO perspective, moving quickly through the phases of development during
rapid iterations. A guru can move the project over mental hurdles, causing
others to see something clearly that eluded them before."
"There are very few gurus in the world today. The rest of us will have to rely
on proven processes and methodologies."
"I've yet to see someone successfully make it past the novice stage and even
consider thinking about software in other than OO terms."