c# - Register to unity or added as reference -



c# - Register to unity or added as reference -

i have 3 module in application. , 1 servicelibrary.

module1 module2 module3 servicelibrary

servicelibrary registered unity when bootstrapper added modules servicelibrary registered unity in module1. like:

_container.registertype<isystemservice>,servicelibrary>();

and service can called other modules too. when called illustration module2 resolve , utilize in module2 like:

isytemservice myserv=_container.resolve<isystemservice>("servicelibrary");

so approach performance?

adding servicelibrary referencte modules or using above resolving unity when needed use. in project there more 100 service library that.

module1, module2, module3 & servicelibrary should reference separate assembly contains iservicelibrary , list of wellknownservice names, , concrete instances should obtained using unity:

isytemservice myserv=_container.resolve<isystemservice>(wellknownnames.servicelibrary);

adding references in modules servicelibrary removes whole point of using ioc container unity.

c# unity-container prism composition prism-4

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -