Search code examples
c#oopagilesoftware-design

Changing winform app for specific clients


I have a winforms app. I give it to three clients and each one wants a small tweak or customization specific just to them. To accomplish this, I'd have to keep a separate version just for each client. I may wind up having many versions doing it this way. I thought dependency injection would be how to handle this but I hear you have to register your dependencies in the main method and you'd still have to add a reference to each clients DLL so I'd still need different versions. What is the preferred object oriented way to handle this? Any better ways to handle this?


Solution

  • You can use a Plug-in patten to load assembly at runtime: (from link)

    Separated Interface (476) is often used when application code runs in multiple runtime environments, each requiring different implementations of particular behavior.

    Most DI frameworks provide this functionality. You can search at get lots of Examples for framework you choose - if you don't want to roll your own.

    1. Ninject
    2. MEF