November 2018
Intermediate to advanced
346 pages
8h 12m
English
So far, we've applied JIT dependency injection to private dependencies with the goal of reducing the parameters and making our data package more straightforward to use.
There is another way to use JIT injection—optional public dependencies. These dependencies are public as we want users to be able to change them but we do not make them, part of the constructor because they are optional. Doing so would detract from the UX, especially in cases where the optional dependency is seldom used.
Imagine we were having a performance problem with the Load all registrations endpoint of our service and we suspected the problem was related to the responsiveness of the database.
Faced with such a problem, we decide that we need ...
Read now
Unlock full access