IoC in class library. Where to bootstrap

前端 未结 4 637
自闭症患者
自闭症患者 2020-12-13 02:39

I\'m using a class library that can be reused by other components. In this class library I\'m using unity for dependency injection. For this class library I create a test pr

4条回答
  •  感情败类
    2020-12-13 02:43

    Doing it from the calling application puts more burden on the calling application. Leaving the chance to omit the initialization and get into trouble.

    I would do it in the class library, for example in a static constructor.

提交回复
热议问题