-
Book Overview & Buying
-
Table Of Contents
Clean Architecture with .NET
By :
In this chapter, we restructured how service composition is defined and executed in a clean architecture application. Rather than allowing the host to assemble registrations manually or rely on convention, we introduced a structured composition boundary that separates the definition of foundational services from their execution.
The Infrastructure layer now defines its service registrations through a ServiceRegistrationPipeline, capturing them as ordered expressions that are executed as
a cohesive unit. The Presentation layer participates through a ServiceCompositionRoot<TPipeline>, contributing its own registrations while delegating foundational concerns to the shared pipeline. This shift clarifies responsibility, enforces ordering, and makes composition observable through structured logging.
We then applied this model in practice. Existing tests were updated to execute the same Infrastructure pipeline directly, ensuring alignment between runtime and testing environments...