Reuse Contracts: Making Systematic Reuse a Standard Practice

Patrick Steyaert, Carine Lucas, Kim Mens

Programming Technology Lab
Vrije Universiteit Brussel
Pleinlaan 2, 1050 Brussel, Belgium
Tel: (32) 2-629-3581
Fax: (32) 2-629-3525
Email: prsteyae@vnet3.vub.ac.be
clucas@vnet3.vub.ac.be
kimmens@is1.vub.ac.be

Abstract:

While object-orientation has had a large impact on the popularisation of reuse, reuse in OO is mostly ad hoc and lessons can be learned from the work on systematic reuse. On the other hand, the emphasis of object-orientation on iterative development is important because it allows the construction of reusable assets in a bottom-up fashion. We claim that systematic reuse needs to be reconciled with iterative development in order to make reuse a standard practice. Such a reuse methodology must emphasise the co-operation between asset providers and asset reusers to control how assets can be reused, how assets are reused and how changes propagate from assets to applications during iterative development. We propose reuse contracts as the basis for such a methodology.

Keywords: Reuse contracts, change management, iterative development, object-orientation.

Workshop Goals: Cross-fertilisation between the OO community and the reuse community, get feedback on our ideas on reuse contracts from the reuse community.

Working Groups: Object Technology, Architectures, and Domain Analysis; Domain Engineering Helps Manage Change.

Background

The Programming Technology Lab is involved in a number of research initiatives that aim to solve mostly technical problems that prevent the establishment of systematic reuse. Both our inspiration on which problems are most important to solve and the validation of our work come from joint projects with industrial partners. These projects are mostly aimed towards the development of frameworks for vertical markets (broadcasting planning, hypermedia, group decision support systems, ...). While before our work mainly focused on implementation aspects, our current goal is to develop a methodology for systematic reuse that covers all phases of the life-cycle and has a strong formalisation, as well as a practical applicability.

Position

Making Reuse Standard Practice in OO

 

It is often claimed that artefacts created with object-oriented techniques are, by their very nature, more reusable than artefacts created with conventional means. Consequently object-orientation has had a large impact on the popularisation of reuse, and object-oriented methods hold many promises for making reuse a standard practice. However, because of the opportunistic - ad hoc - nature, the reuse potential obtained with object-oriented methods alone, leads to marginal gains only. The reuse community has emphasised that to obtain more substantial gains, a more systematic approach to reuse is necessary. Systematic reuse requires a shift from crafting one system at a time to the use of engineering principles for entire families of systems. However, object-oriented software engineering has been traditionally concerned with the development of custom built single systems. So, none of the currently used OOA/OOD methods [1], [2], [3], [4], [5] are suited for this kind of systematic software reuse.

We therefore suggest a methodology that combines the best of both worlds by introducing systematic reuse in the OOSE process. An important problem is how to reconcile the principles that underly systematic reuse with those that underly iterative development in OO. Such iterative development is important because it allows the construction of reusable assets in a bottom-up fashion. This is crucial for reuse to become economically feasible: it allows finding a delicate balance between the longer term investments needed for constructing reusable assets and the need to meet shorter term (customer) deadlines. Our conjecture is that incrementally building reusable assets requires a strong co-operation between providers of reusable assets and asset reusers. Therefore, we propose a methodology that represents this co-operation by an explicit contract and complies to the following criteria.

In the next subsection we propose reuse contracts as a methodology for systematic reuse that respects these criteria.

Reuse Contracts

Based on the problems described above, it is our conjecture that substantial reuse requires a strong and well-defined co-operation between asset providers and asset reusers. We therefore suggest the introduction of explicit reuse contracts [8]. The asset provider must document that part of an asset that is relevant to reusers, while reusers must declare how an asset is actually reused. When reuse is based on such a formal contract, reusers can profit from the changes made to reusable assets because formal rules can be defined that facilitate change propagation. Providers can profit from the information given by reusers to make their assets more reusable. This not only solves the maintenance problem, caused by the proliferation of versions, but also assists in the iterative development, as crucial feedback from reusers is made available to the asset developers.

Because the best-known object-oriented reuse technique today is undoubtedly the use of abstract classes with inheritance, in [8] we focused on the problem of reuse of class hierarchies as a more tangible case to express the ideas behind reuse contracts. In that case, a reuse contract documents the design of a class by means of its specialisation interface [9]. This information is used by reusers to decide which methods have to be overridden and which methods can be inherited. Furthermore, reuse contracts can only be changed by means of formal reuse operators. These encode the different ways a class can be reused and adapted: extension, concretisation and refinement are ╥design preserving╙ operators and their inverses: cancellation, abstraction and coarsening are ╥design breaching╙ operators. Although not the only operators imaginable, they do coincide with the typical ways to reuse abstract classes. Together, reuse contracts and reuse operators record the protocol between providers and users of reusable assets (in this case, abstract classes). Simple formal rules were defined that signal possible conflicts in existing reusers (inheritors), when changes are made to the assets they are reusing (parent classes). Most of the possible conflicts can be directly expressed in terms of reuse contracts and operators rather than on the level of interfaces and calling structures. This allows developers to reason about change in more intuitive terms and on a higher level than previously possible. As reuse contracts can only be adapted by means of certain predefined reuse operators, reuse is disciplined. Moreover, since we also included design breaching operators, reuse is not too coercive.

Because conflicts upon change can be easily detected, reuse contracts help to predict the work effort in updating existing applications. Because they document what aspects possible reusers can rely on, they can also be used by developers of a reuse library to decide whether making a certain change to the reuse library is a good idea or not. In the same vein, conflict detection rules can be used to guide application developers both in understanding where testing is needed when the reusable asset has changed and how to fix the problems.

Up until now, reuse contracts were only fully developed for the reuse of classes in an inheritance hierarchy. Early results on the application of the same principles to reuse of multi-class components and state chart diagrams, however, show a lot of promise regarding the scalability of the approach. Similarly, while this first experiment with reuse contracts mainly concentrated on implementation conflicts, current work is being done to apply the same ideas to the earlier life-cycle phases. These preliminary results support the premise that reuse contracts have a lot of potential as a general reuse methodology.

Comparison

References

1
G. Booch, Object-Oriented Analysis and Design with Applications, (Second Edition). Benjamin/Cummings, Redwood City, CA, 1993.

2
D. Coleman, P. Arnold, S. Bdoff, H. Gilchrist, F. Hayes, and P. Jeremaes, Object-oriented Development: the Fusion method. Prentice Hall, Englewood Cliffs, NJ, 1994.

3
I. Jacobson, M.Christerson, P. Jonsson, and G. Overgaard, Object-Oriented Software Engineering - A Use Case Driven Approach. Addisson-Wesley, 1992.

4
J. Rumbaugh, M. Blaha, W. Premerlani, F. Eddy, and W. Lorensen, Object-Oriented Modeling and Design. Prentice Hall, 1991.

5
E. Yourdon, Object-Oriented System Design: An Integrated Approach. Yourdon Press Computing Systems, Prentice Hall, 1994.

6
A. Goldberg and K. Rubin, Succeeding with Objects: Decision Frameworks for Project Management. Addisson-Wesley, 1995.

7
C. Pancake, ``Object Roundtable, The Promise and the Cost of Object Technology: A Five-Year Forecast,'' Communications of the ACM, vol. 38(10), pp. 32-49, October 1995.

8
P. Steyaert, C. Lucas, K. Mens, and T. D'Hondt, ``Reuse Contracts: Managing the Evolution of Reusable Assets,'' in Proceedings OOPSLA '96, ACM SIGPLAN Notices, pp. 268-285, ACM Press, 1996.

9
J. Lamping, ``Typing the specialization interface,'' in Proceedings OOPSLA '93, ACM SIGPLAN Notices, pp. 201-214, Oct. 1993. Published as Proceedings OOPSLA '93, ACM SIGPLAN Notices, volume 28, number 10.

10
R. E. Johnson and B. Foote, ``Designing reusable classes,'' Journal of Object-Oriented Programming, vol. "1(2), Feb. 1988.

11
S. Cotter and M. Potel, Inside Talingent Technology. Addison-Wesley, 1995.

12
E. Gamma, R. Helm, R. Johnson, and J. Vlissides, Design Patterns. Addisson-Wesley, 1994.

13
R. E. Johnson, ``Documenting frameworks using patterns,'' in Proceedings OOPSLA '92, ACM SIGPLAN Notices, pp. 63-76, Oct. 1992. Published as Proceedings OOPSLA '92, ACM SIGPLAN Notices, volume 27, number 10.

14
W. Pree, Design Patterns for Object-Oriented Software Development. Addisson-Wesley, 1994.

15
G. Krasner and S. Pope, ``A Cookbook for Using the Model-View-Controller User Interface Paradigm in Smalltalk-80,'' Journal of Object-Oriented Programming, pp. 26-49, August/September 1988.

16
I. Jacobson, M. Griss, and P. Jonsson, Software Reuse: Architecture, Process and Organization for Business Success. Addisson-Wesley, 1997.

Biography

Patrick Steyaert holds a post-doc position at the Programming Technology Lab at the Vrije Universiteit Brussel, where he received his PhD in 1994 with work on object-oriented programming languages, reflection and semantics. His current interest is in the integration of reuse contracts in existing object-oriented modeling techniques and the development of a methodology for the iterative development of reusable assets.

Carine Lucas is a teaching assistant and researcher at the Programming Technology Lab at the Vrije Universiteit Brussel. She received a Licentiate Degree in Computer Science from the Vrije Universiteit Brussel in 1991. While before she conducted research in design and typing of object-oriented languages, her PhD will focus on the use of reuse contracts for implementation, maintenance and refactoring of OO software systems.

Kim Mens is a teaching assistant and researcher at the Programming Technology Lab at the Vrije Universiteit Brussel. He received a Licentiate Degree in Mathematics from the Vrije Universiteit Brussel in 1992 and a Licentiate Degree in Computer Science from the same institution in 1994. He has previously been working on object-oriented programming calculi and on typing of object-oriented programming languages. His long-term research goal is to develop the formal foundations of a general reuse methodology, based on the concept of reuse contracts.