While we have been talking specifically about Wire so far in this chapter, I would like to take a moment to discuss the advantages of off-the-shelf injection in a more general sense. When evaluating a tool or framework, it's essential to cast a critical eye over the advantages, disadvantages, and effects on your code that it may have.
Some of the possible advantages of off-the-shelf injection include the following.
A reduction in boilerplate code—After applying constructor injection to a program, it's common that the main() function becomes bloated with the instantiation of objects. As the project grows, so does main(). While this does not impact the performance of the program, it does become inconvenient to maintain.
Many dependency injection frameworks aim to either remove this code or move it elsewhere. As we will...