We're currently in the process of evaluating ways how to specialize a common code base on a per project basis. Think of it as a fully operational system which would be adapted to the project's requirements. Those requirements might be to add additional features or data or to completely or partially replace parts of the system.
There are several options we're considering, e.g. inheritance, strategy patterns, plugins etc. but there are also options like replacing/enhancing functionality in an AOP way.
Since we're already considering different ways of tackling that problem, this question's goal is not to dicuss those ways but rather a single question:
Does anyone know of a preprocessor (free or commercial) that would allow us to replace functionality (classes or even parts of classes like methods) during compile time? It would be similar to AOP with compile time weaving just in that it would not wrap/enhance the code but actually replace the code in question.
Is there even such a thing or would that be too risky/complex?
I know there are better approaches and we're considering them all, so I'd like to know whether this particular approach is worth further consideration.
Other suggestions are welcome but should not result in a completely different dicussion. :)