Ioc/DI - Why do I have to reference all layers/assemblies in application's entry point?

前端 未结 4 990
渐次进展
渐次进展 2020-11-21 04:25

(Related to this question, EF4: Why does proxy creation have to be enabled when lazy loading is enabled?).

I\'m new to DI, so bear with me. I understand that the con

4条回答
  •  你的背包
    2020-11-21 05:04

    • There is a dependency : if an object instantiate another object.
    • There is no dependency : if an object expects an abstraction (contructor injection, method injection ...)
    • Assembly References (referencing dll, webservices..) are independant from the dependency concept, because to resolve an abstraction and be able to compile the code, the layer must reference it.

提交回复
热议问题