dimanche 12 mars 2017

.Net Dependency Injection AUTO REGISTRATION vs Performance

My company uses Unity container with CODE AS CONFIGURATION in desktop application. After reading book Dependency Injection in .Net I thought to propose AUTO REGISTRATIO using Convention over Configuration as the book says use COMPOSITION ROOT to compose the application’s object graph and you should prefer AUTO-REGISTRATION(to avoid violating DRY and to get more manageable code)

But I also watched pluralsight course "Building High-Performance Windows 8 Applications" and author said "assembly load is expensive process as far as performance concern and it is important to avoid unnecessary loading of an assembly in startup path".

I am worried about performance using auto-registration in startup as it requires to use reflection and loading of all assemblies.

I like to understand what is the best approach. Has anyone faced performance issue and dropped auto-registration or found intermediate option?

Aucun commentaire:

Enregistrer un commentaire