I have to work out a small framwork that is going to be used by several of our applications. On top of this, the framework is going to be used multiple times within the same application, but with a slightly different configuration. The 'nature' of the configuration is more complex than just having some configuration options and some setters. In practice, the application has to deliver its own data structures that will be incorporated in the framework, making it even more complex.
I can see the following 4 alternatives in writing the framework:
- Put the common logic in a base class, and tell the application that it should inherit from this base class
- Put the logic in a templated class, in which the application should pass its own class implementation
- Describe the application's specific configuration in a configuration file and generate C++ code during the build process
- Provide macro's that can be used to expand the 'configuration' to actual code
Which arguments should be taken into account when choosing a good alternative?
Are some of these alternatives better than other, and why?
Notice that in my case, performance is a top-priority.