November 2017
Intermediate to advanced
670 pages
17h 35m
English
Dependency injection (DI) is a form of Inversion of Control and also impacts the flow of control in an application. Although the observer pattern's callback mechanism can modify the flow at many times and in many places in an application, DI typically performs the flow of control configuration during application initialization.
Since this chapter is mainly about a layered architecture and the management of dependencies to prevent circular dependency errors, we will not explore pub/sub architectures and the observer pattern. Instead, we will choose DI to reconcile our dependencies in our main function.