Spring.net 与应用程序架构
使用 SPRING.net(我们特别考虑使用它使解耦更容易的方面)与简单地以一种使解耦变得容易的方式重新组织代码相比,有哪些实际的优点/缺点。
我们并不反对引入第三方工具,但这样做必须有明显的好处。
What are the practical advantaged/disadvantages in using SPRING.net (we are specifically considering to use the aspect of it that makes de-coupling easier) vs simply re-organizing your code in a way that makes de-coupling easy.
We are not against introducing third party tools but there has to be a clear benefit when doing so.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
IMO Spring.NET 网站上的概述很好地总结了这一点:
我发现的实际优势是:
更多关于我在 中发现的优点和缺点这个答案。
正如 duffymo 在他的回答中所说,我永远无法“推出我自己的”甚至接近 Spring.NET 的应用程序框架。如果不使用 Spring.NET 或 等应用程序框架,我永远不会在 .NET 中构建企业应用程序城堡。
将 Spring.NET 合并到您的(Brownfield?)应用程序中肯定是可行的。我建议您逐步执行此操作,而不是尝试立即使用框架必须提供的所有内容。因此,请指出您的问题(例如不需要的耦合)并利用框架中有助于解决问题的部分(例如 IoC)。
IMO the overview on the Spring.NET website sums it up nicely:
The practical advantages I found are:
More on the advantages and disadvantages I found in this answer.
As duffymo states in his answer, I would never be able to "roll my own" application framework that comes even close to Spring.NET. I would never ever build an enterprise application in .NET without the use of an application framework such as Spring.NET or Castle.
Incorporating Spring.NET in your (Brownfield?) application is most certainly doable. I'd advice you to do it step-by-step and not try to use everything that the framework has to offer at once. So point out your problems (such as undesired coupling) and leverage that part of the framework that helps out (e.g. IoC).
重新组织代码并不能提供 Spring.NET 所带来的所有好处:
如果所需要的只是重新安排几个类,那么就没有必要使用 Spring 了。
我认为最大的原因是它们在设计、实现和测试方面的严格性。他们编写的代码比我自己编写的代码要好得多。我发现我的项目从使用 Spring 中受益匪浅。我的认识和思维也受到了影响。
Reorganizing code doesn't provide all the benefits that Spring.NET will give you:
If all it took was rearranging a few classes there'd be no reason for Spring.
I think the biggest reason is the rigor they apply to design, implementation, and testing. The code they write is far better than anything I might roll on my own. I've found that my projects have benefitted a great deal from using Spring. My understanding and thinking has been influenced, too.