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 code doesn’t have to change when something in the outer layers changes.
If a use case needs to call a persistence adapter and just instantiates it itself, we have created a code dependency in the wrong direction.
This is why we created outgoing port interfaces. The use case only knows the interface and is provided an implementation of this interface at runtime.
A nice side effect of this programming style is that the code we’re creating is much easier to test. If we can pass all objects a class needs into its constructor, we can choose to pass in mocks instead of the real objects, which makes it easy to create an isolated unit test for the class.
So...