Paul Jones has a new post to his site today with his thoughts about where dependency injection belongs in the application layer structure.
James fuller asks: "any thoughts about which layer of the application we should be using a DI container like Aura.Di? Highest layer possible?" Twitter is too constrained and ephemeral for a good response, so I'll answer that question here.
Based around his definition of a dependency injection container (and service locator), he suggests that the DI container should reside outside of the normal application structure, possibly created in the bootstrap. He also talks some about class inheritance and the use of dependencies passed through from parent to child classes (and how common practices can break this).
Link: http://paul-m-jones.com/archives/5914
没有评论:
发表评论