Class 6 DP Intro Short
Class 6 DP Intro Short
Based on slides of: Mira Balaban Department of Computer Science Ben-Gurion university
F. Tip, J. Vlissides, J. Cooper, IBM T J Watson Research Center.
R. Whitney, San-Diego State University.
D.C. Schmidt, Vanderbilt University.
Sources
1. Classical text: Design Patterns: Elements
of Reusable Object-Oriented Software,
Gamma, Helm, Johnson, Vlissides,
(GoF), 1995
2. Java Design Patterns – A Tutorial, J.W.
Cooper, 2000. (available online)
3. Applied Java Patterns, S. Stelting, O.
Maassen, 2002.
4. Patterns home page:
http://hillside.net/patterns/
Problem
Context Solution
Identify and specify abstractions that are above the level of single
classes or instances, or of components. (GoF)
User interfaces.
benefit
familiarity
understanding
initiation
Ignorance consternation
An object's type only refers to its interface—the set of requests to which it can respond.
An object can have many types, and objects of different classes can have the same type
Disadvantages:
cannot change inherited functionality at run-time, because
inheritance is fixed at compile-time
parent classes define at least part of their subclasses’ physical
representation, and subclasses are exposed to details of their
parent’s implementation
implementation of subclass becomes very tightly coupled with
implementation of parent
change in parent is likely to require changes in subclass