26THE MAIN COMPONENT

Image

In every system, there is at least one component that creates, coordinates, and oversees the others. I call this component Main.

THE ULTIMATE DETAIL

The Main component is the ultimate detail—the lowest-level policy. It is the initial entry point of the system. Nothing, other than the operating system, depends on it. Its job is to create all the Factories, Strategies, and other global facilities, and then hand control over to the high-level abstract portions of the system.

It is in this Main component that dependencies should be injected by a Dependency Injection framework. Once they are injected into Main, Main should distribute ...

Get Clean Architecture: A Craftsman’s Guide to Software Structure and Design now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.