Programming and Design
Ralph Johnson [email protected]
Object-oriented programming and design
Goals: to learn
Frameworks / Design for reuse
Reflection - using objects to implement
Requirements Analysis and Specification
RE process model
(suggested by Bray)
Again, this diagram shows
RE activities (elicitation, analysis,
specification, HMI design)
subsequent design activity (internal design)
RE documents (requirements, specificati
on Analysis Modeling
Use Case Driven Object Modeling with UML A
Practical Approach by Doug Rosenberg
Much of these materials is taken word by word or
paraphrased. This is a good book to have in your
library on OOSE!
Collections and Streams
Composition and reuse
78 subclasses of Collection in Pharo
Some are abstract
Most are concrete - Array, Bag, Dictionary, Interval,
String, Set, Symbol
Poly => many
Morph => shape
Variables take on many shapes, or many
classes of objects.
Object-oriented Programming and
Polymorphism in OOP is caused by latebinding of procedure calls (message
Program can work wi
Intention revealing selector
Naming based on side effects
Boolean property setting
How big should a method be?
Write methods that perform
= vs. =
Object-oriented programming and
Ill take the same thing he is having.
Objects have identity. Their state changes,
but their identity doesnt change.
You can change the
All designers use patterns.
Patterns in solutions come from patterns
"A pattern is a solution to a problem in a
Christopher Alexander - A
"Each pattern describes a problem which o
Design comes from
Modeling (requirements, analysis, problem)
Mending (patch, refactoring)
Memory (patterns, recall)
Things that repeat.
Solutions to a problem in a context.
Patterns for coding/low-level design /
Applications in Smalltalk
Encapsulation and Data
An object should hide design decisions
from its users
what is stored / what is computed
Cant hide everything
Interface of object