This mini-article describes the methods of dependency injection, what each method implies in terms of both performance and simplicity.
- Constructor injection
This method is half manual and quite well known. Declare your classes' dependencies as constructor and pass the dependencies when you construct your instances. This approach completely skips the automation around detection of injections - but performs the best of all methods.