Abstract
We propose a new model for flexible composition of objects from a set of features. Features are similar to (abstract) subclasses, but only provide the core functionality of a (sub)class. Overwriting other methods is viewed as resolving feature interactions and is specified separately for two features at a time. This programming model allows to compose features (almost) freely in a way which generalizes inheritance and aggregation. For a set of n features, an exponential number of different feature combinations is possible, assuming a quadratic number of interaction resolutions. We present the feature model as an extension of Java and give two translations to Java, one via inheritance and the other via aggregation. We further discuss parameterized features, which work nicely with our feature model and can be translated into Pizza, an extension of Java.
Preview
Unable to display preview. Download preview PDF.
References
Lodewijk Bergmans and Mehmet Akşit. Composing synchronization and real-time constraints. Journal of Parallel and Distributed Computing, 36(1):32–52, 10 July 1996.
Gilad Bracha and William Cook. Mixin-based inheritance. ACM SIGPLAN Notices, 25(10):303–311, October 1990. OOPSLA ECOOP '90 Proceedings, N. Meyrowitz (editor).
K. E. Cheng and T. Ohta, editors. Feature Interactions in Telecommunications III. IOS Press, Tokyo, Japan, Oct 1995.
H. J. Fröhlich. Prototype of a run-time adaptable object-oriented system. In PSI '96 (Perspectives of System Informatics), Akademgorodok, 1996. Springer-LNCS.
E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design Patterns: Micro-Architectures for Reusable Object-Oriented Design. Addison Wesley, Reading, MA, 1994.
James Gosling, Bill Joy, and Guy Steele. The Java Language Specification. Addison-Wesley, September 1996.
R. E. Johnson and J. M. Zweig. Delegation in C++. J. of Object-Oriented Programming, 4(3), November 1991.
Jo A. Lawless and M. Molly. Understanding CLOS: the Common LISP object system. Digital Press, Nashua, NH, 1991.
Ole Lehrmann Madsen, Birger Moller-Pedersen, and Kristen Nygaard. Object-Oriented Programming in the BETA Programming Language. Addison-Wesley, Reading, 1993.
Mira Mezini. Dynamic object modification without name collisions. In this volume, 1997.
Martin Odersky and Philip Wadler. Pizza into Java: Translating theory into practice. In Proc. 24th ACM Symposium on Principles of Programming Languages, January 1997.
W. F. Opdyke and R. J. Johnson. Refactoring: An Aid in Designing Application Frameworks. In Proceedings of the Symposium on Object-Oriented Programming emphasizing Practical Applications. ACM-SIGPLAN, September 1990.
Christian Prehofer. From inheritance to feature interaction. In Max Mühlhäuser et al., editor, Special Issues in Object-Oriented Programming. ECOOP 1996 Workshop on Composability Issues in Object-Orientation, Heidelberg, 1997. dpunkt-Verlag.
Christian Prehofer. From inheritance to feature interaction or composing monads. Technical report, TU München, 1997. to appear.
Christian Prehofer. An object-oriented approach to feature interaction. In Fourth IEEE Workshop on Feature Interactions in Telecommunications networks and distributed systems, 1997. to appear.
Linda M. Seiter, Jens Palsberg, and Karl J. Lieberherr. Evolution of object behavior using context relations. In David Garlan, editor, Symposium on Foundations of Software Engineering, San Francisco, 1996. ACM Press.
Lynn A. Stein. Delegation is inheritance. ACM SIGPLAN Notices, 22(12):138–146, December 1987.
Patrick Steyaert, Wim Codenie, Theo D'Hondt, Koen De Hondt, Carine Lucas, and Marc Van Limberghen. Nested Mixin-Methods in Agora. In O. Nierstrasz, editor, Proceedings of the ECOOP '93 European Conference on Object-oriented Programming, LNCS 707, Kaiserslautern, Germany, July 1993. Springer-Verlag.
B. Stroustrup. The C++ Programming Language. Addison-Wesley, Reading, 1991. 2nd edition.
David Ungar and Randall B. Smith. Self: The power of simplicity. Lisp and symbolic computation, 3(3), 1991.
P. Zave. Feature interactions and formal specifications in telecommunications. IEEE Computer, XXVI(8), August 1993.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1997 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Prehofer, C. (1997). Feature-oriented programming: A fresh look at objects. In: Akşit, M., Matsuoka, S. (eds) ECOOP'97 — Object-Oriented Programming. ECOOP 1997. Lecture Notes in Computer Science, vol 1241. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0053389
Download citation
DOI: https://doi.org/10.1007/BFb0053389
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-63089-0
Online ISBN: 978-3-540-69127-3
eBook Packages: Springer Book Archive