|
ABSTRACT
A collection of design patterns was described by Gamma, Helm, Johnson, and Vlissides in 1994. Recognizing that designs change, each pattern ensures that a certain system aspect can vary over time such as the operations that can be applied to an object or the algorithm of a method. The patterns are described by constructs such as the inheritance and reference relations, attempting to emulate more dynamic relationships. As a result, the design patterns demonstrate how awkward it is to program natural concepts of behavioral evolution when using a traditional object-oriented language.In this paper we present a new relation between classes: the context relation. It directly supports behavioral evolution, and it is meaningful at the analysis, design, and implementation level. At the design level we picture a context relation as a new form of arrow between classes. At the implementation level we use a small extension of C++. The basic idea is that if class C is context-related to a base class B, then B-objects can get their functionality dynamically altered by C-objects. Our language construct for doing this is a generalization of the method update in Abadi and Cardelli's imperative object calculus. A C-object may be explicitly attached to a B-object, or it may be implicitly attached to a group of B-objects for the duration of a method invocation. We demonstrate how the context relation can be used to easily model and program the Adapter, Bridge, Chain of Responsibility, Decorator, Iterator, Observer, State, Strategy, and Visitor patterns.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
| |
1
|
|
| |
2
|
Constantine Arapis. Specifying Object Life-Cycles. Object Management, 1990.
|
 |
3
|
Daniel G. Bobrow , Linda G. DeMichiel , Richard P. Gabriel , Sonya E. Keene , Gregor Kiczales , David A. Moon, Common Lisp Object System specification, ACM SIGPLAN Notices, v.23 n.SI, p.1-142, September 1988
[doi> 10.1145/885631.885632]
|
| |
4
|
|
| |
5
|
|
| |
6
|
|
 |
7
|
|
 |
8
|
|
 |
9
|
Richard Helm , Ian M. Holland , Dipayan Gangopadhyay, Contracts: specifying behavioral compositions in object-oriented systems, Proceedings of the European conference on object-oriented programming on Object-oriented programming systems, languages, and applications, p.169-180, September 1990, Ottawa, Canada
|
| |
10
|
Ian M. Holland. The design and representation of object-oriented components. PhD thesis, Northeastern University, 1993. http://www.ccs. neu.edu/home/lieb er/thesesindex.html.
|
| |
11
|
Ralph E. Johnson and Brian Foote. Designing rensable classes. Journal of Object-Oriented Programming, 1(2):22-35, June/July 1988.
|
| |
12
|
|
| |
13
|
Gregor Kiczales, editor. internet publication (http://www.parc. xerox.com/PARC/spl/eca/oi/workshop- 94).
|
| |
14
|
|
| |
15
|
|
 |
16
|
|
| |
17
|
Cristina Videira Lopes and Karl Lieberherr. AP/S++: case-study of a MOP for purposes of software evolution. In Reflection '96, S. Francisco, CA, April 1996.
|
 |
18
|
|
| |
19
|
Sun Microsystems. The Java Language: A White Paper.http://www.javasoft.com.
|
 |
20
|
Harold Ossher , Matthew Kaplan , William Harrison , Alexander Katz , Vincent Kruskal, Subject-oriented composition rules, ACM SIGPLAN Notices, v.30 n.10, p.235-250, Oct. 17, 1995
|
| |
21
|
James Rumbaugh , Michael Blaha , William Premerlani , Frederick Eddy , William Lorensen, Object-oriented modeling and design, Prentice-Hall, Inc., Upper Saddle River, NJ, 1991
|
 |
22
|
|
 |
23
|
|
| |
24
|
Antero Taivalsaari. Object Oriented programming with modes. Technical report, University of Jyvaskyla, Finland,1991.
|
 |
25
|
|
| |
26
|
Cun Xiao. Adaptzve Software: Automatic Navigation Through Partially Specified Data Structures. PhD thesis,Northeastern Uuniversity, 1994. http://www.ccs. neu.edu/home/lieber/thesesindex.html.
|
CITED BY 9
|
|
|
|
|
|
|
|
|
|
Craig Chambers , Bill Harrison , John Vlissides, A debate on language and tool support for design patterns, Proceedings of the 27th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.277-289, January 19-21, 2000, Boston, MA, USA
|
|
|
|
|
|
|
|
|
Peer to Peer - Readers of this Article have also read:
-
Data structures for quadtree approximation and compression
Communications of the ACM
28, 9
Hanan Samet
-
A hierarchical single-key-lock access control using the Chinese remainder theorem
Proceedings of the 1992 ACM/SIGAPP Symposium on Applied computing
Kim S. Lee
, Huizhu Lu
, D. D. Fisher
-
The GemStone object database management system
Communications of the ACM
34, 10
Paul Butterworth
, Allen Otis
, Jacob Stein
-
Putting innovation to work: adoption strategies for multimedia communication systems
Communications of the ACM
34, 12
Ellen Francik
, Susan Ehrlich Rudman
, Donna Cooper
, Stephen Levine
-
An intelligent component database for behavioral synthesis
Proceedings of the 27th ACM/IEEE Design Automation Conference on
Gwo-Dong Chen
, Daniel D. Gajski
|