Code your own IOC Container

前端 未结 12 923
眼角桃花
眼角桃花 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:35

    James Kovacs presents a dnrTV episode on this subject here. Here also wrote an article. However during the article he mentions that you would probably want to use one of the pre-built ones. Since there are many diverse looks for them. Ninject, StructureMap, Autofac use a fluent interface. Spring, Castle Windsor, and Unity are more XML config driven. Castle Windsor can also use boo as an interface. Many have hooks to other frameworks such as Unity to EntLib or Castle Windsor to Monorail and the rest of the Castle Project.

    So unless you really need or want something that is not provided by the IOC frameworks available, then why not use one of them.

提交回复
热议问题