I am working an on application that has uses in various domains.
In most of the domains what the users what to do with the system is the same but some things differ slightly, ie. some domains require extra screens or functionality or different business rules, but overall there is quite a lot of similarity between them.
At the moment each domain has its own application that is copy/pasted from a previous one and modified to suit. As you can imagine this is not ideal and results in a lot of duplication/rework/headaches.
I’m wondering if there is any guidance in developing an application or suite of applications like this that share quite a bit of similarity (up to a point) without having these same issues?
I have considered creating a generic domain that would suit all of these domains. I have worked on applications previously that use this approach and have found that things get so complicated and there are lots of switches required to enable/disable certain functionality. Essentially it ended up that the domain was so generic that it really didn’t mean anything to anyone and was incredible hard to customise for specific domains.
If it makes any difference it would be an asp.net mvc application written in c# and .net 4
My suggestion is to make exactly one frontend application for each domain/user group, and keep shared backend tiers wherever it is appropiate for resources to be shared. You need to sit down and think hard what makes sense for the frontend domains to be shared and implement that in shared tier (i.e: web service, databases, message queues, etc.)
Also, if there is a lot of duplication in the frontend design, you need to try to write reusable components (shared libraries), however, this suggestion is hardly useful when cast in retroactive form; if the frontend applications already exists, as you state, then its hard without a big refactoring effort.
if you find yourself placing switches to cover lots of cases, it means you are trying to godify your domain objects, trying them to make more than they should. it also suggest you need to add an additional layer, more frontend-specific that hides the switching logic (or entirely avoids it)