是否有一个.NET的IoC是prefers约定优于配置?有一个、NET、prefers、IoC

2023-09-03 10:26:20 作者:〃香烟。也燃不尽的寂寞

简单地说,如果你有使用的IoC / DI容器,这就是易于部署,稳定,良好的文档(使用config / xml文件的一切不是一个大风扇),并支持.NET,哪一个会是什么?

Simply put, if you had to use a IoC/DI container, thats easy to deploy (not a big fan of using config/xml file for everything), stable, good documentation and supports .net, which one would it be?

这可能只是我,但喜欢一个用于应用程序,少数为ORM,少数为另一个组件还挺获得压倒性有时太多的XML文件。另外,我认为,如果有做的事情(约定)搞乱的东西了较少的机会的一种方式的方式。

It could just be me but too many xml files like one for the app, a few for ORM, a few for another component kinda gets overwhelming at times. Also, the way I see it, if there is one way of doing things (convention) lesser the chances of messing things up.

期待你的建议,如果可能的经验。我主要关注的是可维护性和易部署性。

Looking forward at your suggestions and if possible experiences. My main concern is maintainability and ease of deployment.

推荐答案

我用 Ninject 和的 StructureMap - 都允许接线的配置,而无需XML。

I use Ninject and StructureMap -- both allow you to wire up your configuration without XML.

为了不被无耻地促进我的网站,但我写的教程使用Ninject提供这里。

Not to be shamelessly promoting my site but I wrote a tutorial on using Ninject available here.