Position Statement for working group on object-oriented programming, within the ACM Workshop on Strategic Directions in Computing Research, to be held at MIT, June 14-15 1996. Title: From Transience to Persistence in Object Oriented Programming: Architectures and Patterns Author: Karl Lieberherr Object-oriented programs (like most programs) evolve over time and it would be ideal if we could capture persistent parts of the programs early on and then derive the transient versions of the program from the persistent part. In our view, the oo programming community is moving in this direction through its work on software architecture and patterns. Capturing the persistent parts of a program allows us to better maintain the integrity of the program during evolution. Software Architecture The goal of software architecture is to capture the persistent parts of the program and to use an architectural doctrine to derive the transient versions using architecture refinement. A number of architecture description languages are under development. Common to many of those architecture description language is the concept of components and connections between them. Work in this area is supported by DARPA's software composition program and includes CMU, Stanford, SRI, Ohio State and Northeastern. This work is summarized at URL http://www.stars.reston.unisysgsg.com/arch/guide.html The work at Northeastern on software architecture is distinguished by using adaptive programming (AP) to capture architecture. This has the advantage that architectural refinements can be automated in many cases. An adaptive program tries to capture the persistent parts of an object-oriented program by using traversals and context objects. Traversals are specified succinctly taking advantage of the structure of object-oriented programs. Work on AP is collected in the book [DEMETER] and in [CONTEXT]. The work on meta-object-protocols is also concerned, to some degree, with persistence versus transience and with software architecture. The idea is that the persistent parts of the program are expressed at the base level while the transient parts are expressed at the meta level. The meta level provides building blocks for the base level and ideally most changes to the program can be accomplished by changing the meta objects and programs. See URL: http://www.parc.xerox.com/spl/projects/oi/ Patterns Work on patterns in software development has been popularized by the design pattern book [GOF]. Patterns can be classified in different categories: programming, design, architectural and organizational. Patterns contribute to capturing the persistent parts of a program by describing often used solutions to problems in a context. Groups of collaborating patterns can be used to describe architectural doctrines. Patterns can be powerful to describe the overall organization of a program. Therefore there is a close connection between software architecture and patterns. Design patterns in [GOF] are patterns of object interaction to address flexibility of evolution. Therefore, those patterns can be modeled by n-ary connections in an architecture description language. The need for certain design patterns can be eliminated by improving the underlying programming language. This can be done by adding context objects and traversals to the programming language [CONTEXT]. The work on design patterns will develop in a number of directions. New patterns will be added to the catalog of well known patterns. Patterns of different levels of abstraction will be developed. Finally, well known patterns will be supported directly by tools. To develop those tools, it is necessary to have a notation to describe patterns so that a tool can operate with patterns. Tasks which can be automated are: analyzing patterns customizing patterns composing patterns retrieving patterns Analyzing means to check whether the pattern is ``type-correct'' and customizing means to check for proper application of a pattern to a program and to automatically create the code prescribed by a pattern. The emerging field of architecture description languages can play an important role in producing models and tools to make work with patterns even more productive. An architecture description language ought to be expressive enough to express design and even some architectural patterns. However there are high-level patterns which will not (yet) lend themselves to automation. For example, the formulation of AP in terms of patterns (see http://www.ccs.neu.edu/research/demeter/adaptive-patterns/AP.txt) leads to three high-level patterns, called Class Graph, Structure-shy Object and Adaptive Visitor (synonym: Structure-shy Behavior) which would be hard to describe formally and to automate. What kind of features do architecture description languages need to express design patterns? \bi \item Pattern Abstraction One important feature which stands out is a facility to express patterns abstractly, without referring to unimportant details. Yet the patterns must be customizable to lead to specific execution behavior. Customization adds details and creates an executable program which controls the interaction specified by the pattern. The concepts of AP offer new ways to describe patterns succinctly. \item Applicability Constraints A pattern consists of a partial object interaction specification and an applicability condition. By ``applicability condition'' we mean restrictions on the set of entities that collaborate for the purpose of the interaction. The applicability condition specifies the contexts in which the pattern may be applied. Therefore, an architecture description language needs to express applicability constraints for patterns. \ei More work is needed to explore techniques which allow us to better express the persistent properties of program families. DEMETER: @BOOK{karl:demeter, AUTHOR = "Karl J. Lieberherr", TITLE = "Adaptive Object-Oriented Software: The Demeter Method with Propagation Patterns", PUBLISHER = "PWS Publishing Company, Boston", YEAR = "1996", NOTE = "ISBN 0-534-94602-X" } (see URL: http://www.ccs.neu.edu/research/demeter) GOF: @BOOK{gang-of-4, AUTHOR = "Erich Gamma and Richard Helm and Ralph Johnson and John Vlissides", TITLE = "Design Patterns: Elements of Reusable Object-Oriented Software", PUBLISHER = "Addison-Wesley", YEAR = "1995" } CONTEXT: Linda Seiter, Jens Palsberg, Karl Lieberherr, Context Objects (see URL: ftp://ftp.ccs.neu.edu/pub/people/lieber/context.ps) The theme of persistence versus transience was suggested in a talk by Kesav Nori at the Tata Research Center in Pune, India. This theme nicely captures the common ground between adaptive programming, software architectures and patterns.