December 2019
Intermediate to advanced
510 pages
11h 33m
English
A key point to master when we deal with dependency injection is the services life cycle. The services life cycle is an essential concept about performance, because a wrong service life cycle may cause complicated performance degradation.
The object lifetime in .NET is simple: the object is instantiated, used, and finally disposed of by the garbage collector. The dispose phase is the most relevant in terms of performance. In a dependency injection process, the consumer of a specific dependency does not control its lifetime. Indeed, dependencies are usually initialized by the dependency injection container, and they continue to exist until all their consumers hold them.
Read now
Unlock full access