Frameworks = Components + Patterns
Ralph Johnson, CACM Nov. 1997
Self-documentation Principle
Bertrand Meyer, OO Software Construction 2nd ed.
the designer of a module should
strive to make all information about the module
part of the module itself ...
slide: Frameworks = Components + Patterns
The benefits of frameworks stem from the inversion of control
A Framework defines an Architecture?
slide: The benefits ...
Software Architecture =
a set of rules, guidelines, interfaces, and conventions
used to define how components and applications communicate
and interoperate with eachother ...
see patterns
slide: Software Architecture
A Catalogue of Design patterns
- a common design vocabulary
- documentation and learning aid
- an adjunct to existing methods
- a target for redesign
see the
GOF Design Patterns
and the Patterns Homepage
slide: A Catalogue of Design patterns
structure
Name - handle
- increases design vocabulary
Problem - when to apply
- explains the problem and the conflict
Solution - general arrangement
- design, responsibilities, collaborations
Consequences - tradeoffs
- to understand the costs and benefits
slide: The Pattern Schema
Causes for Redesign
design for change
- creating an object by specifying a class explicitly
-- Abstract Factory, Factory Method, Prototype
- dependence on specific operations
Chain of Responsibilty, Command
- dependence on hardware & software platforms
-- Abstract Factory, bridge
- dependence on object implementation or representation
Abstract Factory, Bridge, Memento, Proxy
- algorithm dependence
-- Builder, Iterator, Strategy, Template Method,
Visitor
- extending functionality by subclassing
-- Bridge, Chain, Composite, Decorator, Observer
- tight coupling
-- Abstract Factpry, Bridge, Chain of Responsibilities,
Command, Facade, Mediator, Observer
- inability to alter classes conveniently
-- Adaptor, Decorator, Visitor
slide: Causes for Redesign
Kinds of Patterns
- creational patterns -- factory, singleton, ...
- structural patterns -- adaptor, composite, bridge, ...
- behavioral patterns -- mediator, observer, command, ...
see also
see UML
slide: Kinds of Patterns
If |
| Java |
| | is the Answer, |
What is |
| | the Question? |
see Ted Lewis, IEEE Computer, March 1997, p. 136
slide: What is the Question?
The dream: UNCOL
- Java is pervasive
- remember, most of Java is just warmed-up C/C++
UNCOL = Universal Common Language
- (1963) Algol -> PL/I -> Pascal -> Ada -> C++ -> ...
- Java as UNCOL: the dial-tone of the Internet
if todays languages are inadequate for Software
then Java must be inadequate too ...
slide: The dream: UNCOL
Hostages of legacy code
- our responsibility is that future applications (built with Java)
are well-behaved legacy systems
- US DOD:
slide: Hostages of legacy code
Is Java doomed to repeat history?
- elegant minimalism is one of the goals of Java,
remember Pascal, a toy language!
- Java lacks IO, OS support ...
slide: Is Java doomed to repeat history?
Java = watered-down C++, retrofitting Pascal
Problems
- syntax: int i = ++i--;
- unruly scope rules: C++ plus f i n a l,
n a t i v e, s y n c h r o n i z e d, ...
- threads: potential deadlocks
slide: Java = ...
Java: a better mousetrap?
- requirements: no support (assert)
- defacts: syntax, non-standard APIs
- components: Beans ActiveX, CORBA, OpenDoc
- cycle time: Java does little to accommodate Internet time,
like script languages do
- complexity: Java does not advance the intellectual frontier!
slide: Java: a better mousetrap?
CORBA
- the issue is standardization
- by means of interfaces
- looking for consensus
- this differs from a de-facto standard
- imposed by market share ...
See Ch 6: Component Technology
and
see frameworks
slide: CORBA
Dimensions of Risks
- Knowledge
- Teaming
- Productivity
- Ownership
- Distractions
Don't discuss risks, unless you know how to
do Project Management
slide: Dimensions of Risks
Risk Reduction Strategies
slide: Risk Reduction Strategies
knowledge
- clear the fog -- get to the real issues
- early and regular delivery -- discover what you don't know
- prototype! -- discover how it really works
- create microcosm -- do something real, but with care
slide: Knowledge
teaming
- holistic diversity -- coordinate specialists!
slide: Teaming
productivity
- gold rush -- start immediatly, adjust slowly
slide: Productivity
ownership
- function / component owners -- create responsibility
slide: Ownership
distraction
- someone always makes progress -- no total interruption
- team per task -- a subteam deals with diversions
- sacrifice one person -- and preserve the team
slide: Distraction
training
- day care -- hire an expert to take care of novices
slide: Training