c# - Developing one solution with slightly different modules for every country -
currently i'm developing 2 solutions (first country a, second country b), similar. i'm using wpf, c#, mvvm, sql server.
some of modules identical in every solution, of them partially different (ex. classes have additional fields or methods), , different (ex. vat module). me, developing independent solutions not best solution (time cost).
so, thinking of creating 2 solutions (a , b) contain main screen prepare user interface. then, in third solution (c) have project (=modules) , link them or b.
if module identical both version - no problem. if different - ok, must develop independently. but, question how design modules different?
should use abstract factory design pattern , put in abstractproduct identical, , in concreteproducts put additional fields/methods? wpf forms can't use pattern - must develop form every version.
thx.
what want use dependency injection.
first create interface have concrete impls implement interface per country.
interface isolution { .... } class countrya : isolution{ ... } class countryb : isolution{ ... } then register these interface impl mapping @ composition root.
private static icontainer configuredependencies() { return new container(x =>{ x.for<isolution>().use<countrya>(); }); } then ask container give instance of isolution. , provide correct impl.
you can same countryb.
you can have auto wiring or late binding, more dynamic. , can switch impls.
take @ structuremap examples.
Comments
Post a Comment