How, in your opinion, should we code to handle enabling or disabling features based on the installation type. Purpose is to have a single installation for separate editions and make features available based on the installation type.
One way of doing it is to conditionally compile the code but that makes the code dirty and difficult to maintain.
You can resort to plugin-based architecture, where all (or most) features are implemented as plugins that extend core app functionality. This way, your editions will differ only in what assemblies get installed/shipped/etc.
Granted, with this approach you can always make a “Starter” edition to turn into “Professional” by just copying missing assemblies. To solve this, you’ll still have to resort to conditional compilation, but you’ll have to conditionally compile blocks which are responsible for loading those plugins.
For example, suppose for your Professional edition you want to be able to add, say, export functionality. To that end, you create a separate
IExporterplugin interface. Here’s how you handle this:Thus, your Professional edition will have an ability to be extended with custom
IExporters, whereas non-Professional editions, even with all “Professional” assemblies in place, won’t be able to make use of this functionality.