Introduction to FeatureC++


Feature-Oriented Programming

FOP studies feature modularity in program families. The idea of FOP is to build software by composing features. Features are basic building blocks that satisfy intuitive user-formulated requirements on the software system. Features refine other features incrementally. This step-wise refinement leads to a layered stack of features. Mixin Layers are one appropriate technique to implement features. The basic idea is that features are often implemented by a collaboration of class fragments. A Mixin Layer is a static component encapsulating fragments of several different classes (Mixins) so that all fragments are composed consistently. Mixin Layers are an approved implementation technique for component-based layered designs. Advantages are a high degree of modularity and an easy composition.


FeatureC++

Feature-Oriented Programming (FOP) is an appropriate technique to cope with the problems of the software crisis, in particular with increasing complexity as well as lacking reusability, and customizability. This is documented by successful case studies in the domains of GUI libraries, Avionics, DBMS, and network drivers. Current research on modern programming paradigms such as FOP focuses on Java. AHEAD and the AHEAD Tool Suite (ATS) are prominent examples. Although used in a large fraction of applications like operating systems, realtime and embedded systems, or databases and middleware C/C++ is rarely considered. Current solutions for C++ utilize templates, simple language extensions, or C preprocessor directives. These approaches are complicated, hard to understand, and not applicable to larger software systems. Thus motivated, this article presents FeatureC++ a language proposal for FOP in C++. Besides basic concepts, known from other FOP languages, FeatureC++ exploits useful concepts of C++, e.g. multiple inheritance or templates, to name a few. FeatureC++ combines the advantages of FOP and Aspect-Oriented Programming (AOP) to solve well-known problems of FOP, in particular the lack of crosscutting modularity. We argue that some features of AOP can help to solve these problems. Mainly the ability to implement dynamic crosscutting and the avoidance of method shadowing, as well as the growing acceptance, motivates us to choose AOP. FeatureC++ introduces the notion of Aspectual Mixin Layers which encapsulate Mixins and Aspects. A further benefit of FeatureC++ is the solution of different problems of objectoriented languages, namely (1) the constructor problem, which occurs when minimal extensions have to be unnecessarily initialized, (2) the extensibility problem, which is caused by the mixture of class extensions and variations, and (3) hidden overloaded methods in C++, which are hindering for step-wise refinements.