I have such a design in my mind.... My aim is to reuse the program with some features included and without some features. What is it called in the literature? More information: there are events.. Events cause calls to function1() or function2()...
Features have functions which are called when events takes place. A feature may influence what functions are called at a event. A feature may influence what is executed for more than one event.
So it looks it could be the observer pattern + hasa relationship...
class feature1
{
void feature1functionx();
void feature1functiony();
}
class feature2
{
void feature2functionw();
void feature2functionz();
}
class program: feature1, feature2
{
vector<string> data;
void function1()
{
feature2functionw();
}
void function2()
{
feature1functiony();
feature2functionz();
}
void execute()
{
function1();
function2();
}
}