10
Assembling the Application
Now that we have implemented some use cases, web adapters, and persistence adapters, we need to assemble them into a working application. As discussed in Chapter 4, Organizing Code, we rely on a dependency injection mechanism to instantiate our classes and wire them together at start-up time. In this chapter, we’ll discuss some approaches to doing this with plain Java and the Spring and Spring Boot frameworks.
Why even care about assembly?
Why aren’t we just instantiating the use cases and adapters when and where we need them? Because we want to keep the code dependencies pointed in the right direction. Remember: all dependencies should point inward, toward the domain code of our application, so that the domain ...
Get Get Your Hands Dirty on Clean Architecture - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.