Code your own IOC Container

前端 未结 12 919
眼角桃花
眼角桃花 2020-12-08 00:52

Has anyone out there written their own IOC Container in C#? Or do the vast majority of folks use the various frameworks such as Spring. What are the pro\'s and con\'s of eac

12条回答
  •  鱼传尺愫
    2020-12-08 01:15

    Unless there's a very good reason I wouldn't go reinvent the wheel and implement a IoC container myself, specially because there are are a lot of good options like Unity, Ninject or Spring.net.

    If you need/want to remove the dependency to any of these IoC containers you may try out the Common Service Locator interface.

提交回复
热议问题