Feature-oriented programming: A fresh look at objects

C Prehofer - European Conference on Object-Oriented …, 1997 - Springer
C Prehofer
European Conference on Object-Oriented Programming, 1997Springer
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 …
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.
Springer