oo - Vrije Universiteit Amsterdam
Download
Report
Transcript oo - Vrije Universiteit Amsterdam
Object-Oriented Software
Engineering
Anton Eliëns
Vrije Universiteit, Amsterdam
28 october 1998
http://www.cs.vu.nl/~eliens/cmg/html/oo
http://www.cs.vu.nl/~eliens/online/courses/cmg/oo
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Topics:
•
•
•
•
•
OO technology
The OO life cycle
Project Management
Application Frameworks
Current developments and trends
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Introduction
If
OO
is the Answer,
What is
the Question?
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Keywords and phrases
• the OO lifecycle -- modelling
• encapsulation, inheritance, delegation,
polymorphism
• specification and implementation inheritance
• design by contract
• interfaces, components and frameworks
• idioms, patterns, software architecture
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Characterisations of OO
1. encapsulation + inheritance
2. data abstraction + polymorphism
3. interfaces + components
4. types + implementations
5. CORBA + Application Frameworks
6. Java + nothing else
7. a metaphor + hype
8. everything I can sell …
Let's have a look at the Introduction from Principles of Object-Oriented
Software Development
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Managing O-O Projects
Did
YOU
ever
manage
a
project?
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Critical Success Factors
•
•
•
•
use incremental scheduling and staging
find and fix failing ideas
develop a habit of delivering
get: sponsor, project manager, technical leader
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Key Failure Indicators
• absence of incremental development
• use of C++ in commercial IS
see Surviving Object-Oriented Projects: A Managers Guide
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
OO - Success and Failure
•
•
•
•
OO = technology + mind-set
it might be new technology to your organisation
developers love it!
requires and enables communication between
groups
• adopting OO may succeed or fail!
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Possible benefits - responsiveness
•
•
•
•
•
•
•
responsiveness - variations on a theme
responsiveness to change!
time-to-market
communication - developers, users, executives
maintenance, reuse, productivity
GUI development
morale -- cutting-edge technology
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Drawbacks
•
•
•
•
•
•
•
•
Are YOU underestimating?
productivity takes time
hazards of C++ (and Java, ...)
reuse is difficult
establishing a software process
business-modelling or software design?
CASE helps?
You will pay for: training, experience, tools,
consultants, ...
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
The hazards of C++?
• C++ won the language war over Eiffel,
Objective-C, SOM, C@+, and Java?
• Java -- relative simplicity and portability
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Managing (the complexity of) C++
• misconception: C++ is like C
• consider using another language
• Why does C++ exist? - engineering and
systems programming
• create a subset of the language
• design and coding standards
• use people with knowledge!
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Risk-reduction Strategies
•
•
•
•
look carefully all around the project
detect the risks!
list the risks in order
work on the risks in order of danger
see Risk Avoidance Patterns
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Case studies: Application Framework
• The hush Framework
• The San Francisco Framework
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Technology and Trends
UML
Risks
Java
Frameworks
Contracts
CORBA
Patterns
DOT
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
The Unified Modelling Language
• use case diagram
• class diagram
• behaviour diagrams:
– state-chart diagram
– activity diagram
– interaction diagrams:
• sequence diagram
• collaboration diagram
• implementation diagrams:
– component diagram
– deployment diagram
For some background see: Ch. 11: Methods and Tools
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
UML - Quick Reference and Overview
adapted from the Rational Rose Quick Reference
at http://www.rational.com/uml/qr
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Design by Contract
• formal basis -- pre and post conditions
• refinement -- by inheritance or polymorphism
• runtime checks -- division of responsibility
see Ch. 3, Contracts
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Frameworks
• 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 ...
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
The benefits
The benefits of frameworks stem from the
inversion of control.
A Framework defines an Architecture?
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Software Architecture
Software Architecture = a set of rules, guidelines,
interfaces, and conventions used to define how
components and applications communicate and
interoperate with each other ...
see patterns
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
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
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
The Pattern Schema: structure
• Name - handle
– increases design vocabulary
• Problem - when to apply
– explains the problem and the conflict
• Solution - general arrangement
– design, responsibilities, collaborations
• Consequences - trade-off's
– to understand the costs and benefit
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Causes for Redesign (1)
1. creating an object by specifying a class
explicitly -- Abstract Factory, Factory Method,
Prototype
2. dependence on specific operations -- Chain of
Responsibility, Command
3. dependence on hardware & software platforms
-- Abstract Factory, Bridge
4. dependence on object implementation or
representation -- Abstract Factory, Bridge, Memento,
Proxy
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Causes for Redesign (2)
5. algorithm dependence -- Builder, Iterator, Strategy,
Template Method, Visitor
6. extending functionality by subclassing -- Bridge,
Chain, Composite, Decorator, Observer
7. tight coupling -- Abstract Factory, Bridge, Chain of
Responsibilities, Command, Facade, Mediator, Observer
8. inability to alter classes conveniently -- Adaptor,
Decorator, Visitor
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Kinds of Patterns
• creational patterns -- Factory, Singleton, ...
• structural patterns -- Adaptor, Composite, Bridge, ...
• behavioral patterns -- Mediator, Observer,
Command, …
see also
see UML
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Java
If
Java
is the Answer,
What is
the Question?
see Ted Lewis, IEEE Computer, March 1997, p. 136
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
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 today's languages are inadequate for Software
then Java must be inadequate too ...
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Hostages of legacy code
• our responsibility is that future applications (built
with Java) are well-behaved legacy systems
• US DOD: $ 30 billion in year 2000 problem
• maintaining legacy COBOL from the 70's is a
major industry ...
• by 2010, Java will be the maintenance tail
wagging the software dog!
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
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 ...
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Problems
• Java = watered-down C++, retrofitting Pascal
– 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
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
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!
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
CORBA
•
•
•
•
•
the issue is standardisation
by means of interfaces
looking for consensus
this differs from a de-facto standard
imposed by market share ...
see Ch 11: Application integration -- standards
and
see frameworks
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Dimensions of Risks
•
•
•
•
•
Knowledge
Teaming
Productivity
Ownership
Distractions
Don't discuss risks, unless you know how to do Project
Management
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
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
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Risk Reduction Strategies
• Teaming
– holistic diversity -- co-ordinate specialists!
• Productivity
– gold rush -- start immediately, adjust slowly
• Ownership
– function / component owners -- create responsibility
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Risk Reduction Strategies
• Distractions
– someone always makes progress -- no total
interruption
– team per task -- a subteam deals with diversions
– sacrifice one person -- and preserve the team
• Training
– day care -- hire an expert to take care of novices
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Conclusions
• OO offers
–
–
–
–
a valid metaphor for SE
powerful technology
maturing design methods and notations
a rich set of patterns
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Yet beware of
•
•
•
•
the learning curve
simplified hype
cutting edge technology
(over) ambitious projects
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Assignments:
• Write a paper about one of the following topics.
The paper may discuss concepts or focus on a
case study.
– The Unified Modelling Language -- UML
– Frameworks -- for example San Francisco
• Write a comparative study of object-oriented
analysis and design methods, focussing on
aspects of project management.
• Describe a case study concerning the
deployment of design patterns.
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam
Course material
• Chapter 1
• Additional material
– Ch 3: Design by Contract
– Ch 11: Methods and Tools
– Object Tutorials
• Resources
– http://www.rational.com -- Rational Rose, UML
– http://www.ibm.com/java/sanfrancisco -- IBM Java San Francisco
Framework
• Papers and Reports
– http://www.rational.com/uml/html/summary -- UML Summary
– http://www.ibm.com/Java/Sanfrancisco/prd_summary.html -- San
Francisco Technical Summary
Postacademische Cursus Informatie Technologie
vrije Universiteit
amsterdam