So, if IoC is the Context how do we
leverage this concept so we can package it up nicely in our code bases. The goal
is to use this context to unlock new aspects.
I have an application factory class that generates application instances.
The factory is responsible for bootstrapping the logging, doing all of the
assembly scanning, then passes a TypePool and the container into the application.
The application instance looks like this
The Start method looks like
The ApplicationMarker looks like
Benefits include super simple testing
a predictable and shared common architecture across command line apps
web apps / messaging apps (this is very nice for larger companies)
In integration tests I can say things like:
Now I know that my app instance is the same as how its going to be built in
in test as it is in the application host.