Before discussing FOSD (Feature Oriented Software Development), we have to know the concept of SPL (Software Product Line) due to it is the origins of FOSD.
A SPL defines a set of distinct but related programs. These programs always have a lot of commonality.
Examples: Purchasing Macbook in Apple store, choose type and all kinds of features you want then click check-out.
Refinement: process of adding implementation detail without changing semantics. (Implement interfaces)
Extension: process of adding details to augment or extend semantics/capabilities. (Inherit classes of interfaces)
Features all extensions. Feature = layer of software.
GenVoca is the first generation of FOSD model. The name is a meld of the names Genesis and Avoca.
Genesis is the first building-blocks technology for DBMS, using a graphical layout editor to customize a DBMS which is specified by composing prefabricated software components. Shows as bellow:
Avoca is a system for constructing efficient and modular network software suites using a combination of pre-existing and newly created communication protocol.
Adaptor: object whose goal is to translate from one OO interface to another.
Decorator: a wrapping object that exports and imports the same (basic) interface and whose purpose is to add more functionality to the wrapped object.
GenVoca features were originally implemented using C preprocessor (#ifdef feature ... #endif)
techniques. A more advanced technique, called mixin layers, showed the connection of features to object-oriented collaboration-based designs.
Limitation: Fixed interfaces were simply too rigid. (Solution: Mixin)
There is only one base program, 0 (the empty program), and all features are unary functions. This suggests the interpretation that GenVoca composes program structures by superposition, the idea that complex structures are composed by superimposing simpler structures.
GenVoca is as a monoid: a GenVoca model is a set of features with a composition operation (•); composition is associative and there is an identity element (namely 1, the identity function).
Multi-featured applications are expressions:
Mixin layers is the second generation of FOSD model. It is a refinement of GenVoca.
Problems arise from a typical features called collaborations. It simultaneously modify multiple objects/entities, and refinement of single entity is called role. Example shows as bellow:
How to handle this problem? The answer is mixin and bellow is what we want in Java. (class whose superclass is parameterized is a mixin)
However it is not possible in Java, but there is other solutions:
Why the second solution of mixin by inheritance could work? These is because it is the same as frameworks and plug-ins design.
What happens is as bellow:
Algebraic Hierarchical Equations for Application Design (AHEAD) is the third generation of FOSD model. It generalized GenVoca+Mixin in two ways.
The original implementation of AHEAD is the AHEAD Tool Suite and Jak language, which exhibits both the Principles of Uniformity and Scalability. Next-generation tools include CIDE and FeatureHouse.
Example:
Acknowledgement:
This article is my learning notes of course CS392F Automated Software Design, lectured by Prof. Don Batory. The core idea of this course is how to write programs to generate other programs in a scientific way, that is, not by hacking.