Spring.net 与应用程序架构

发布于 2024-12-04 15:00:46 字数 114 浏览 2 评论 0原文

使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

找回味觉 2024-12-11 15:00:46

IMO Spring.NET 网站上的概述很好地总结了这一点:

Spring.NET 提供全面的基础设施支持
开发企业 .NET 应用程序。它允许您删除
使用基类库时的附带复杂性是最好的
实践,例如测试驱动开发、简单实践。

我发现的实际优势是:

  • 它通过从我的演示文稿和域对象中移出几乎所有基础设施代码,指导我构建可理解、可测试和可维护的软件;我发现我可以轻松可靠地更改我的代码,
  • 而且不会造成干扰;为您提供所需的所有自由

更多关于我在 中发现的优点和缺点这个答案

正如 duffymo 在他的回答中所说,我永远无法“推出我自己的”甚至接近 Spring.NET 的应用程序框架。如果不使用 Spring.NET 或 等应用程序框架,我永远不会在 .NET 中构建企业应用程序城堡

将 Spring.NET 合并到您的(Brownfield?)应用程序中肯定是可行的。我建议您逐步执行此操作,而不是尝试立即使用框架必须提供的所有内容。因此,请指出您的问题(例如不需要的耦合)并利用框架中有助于解决问题的部分(例如 IoC)。

IMO the overview on the Spring.NET website sums it up nicely:

Spring.NET provides comprehensive infrastructural support for
developing enterprise .NET applications. It allows you to remove
incidental complexity when using the base class libraries makes best
practices, such as test driven development, easy practices.

The practical advantages I found are:

  • it guides me to building understandable, testable and maintainable software, by moving out almost all infrastructural code from my presentation and domain objects; I find that I can easily and reliably make changes to my code
  • it is non-obtrusive; gives you all the freedom you need

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).

迎风吟唱 2024-12-11 15:00:46

重新组织代码并不能提供 Spring.NET 所带来的所有好处:

  1. 控制反转 (IoP)
  2. 面向方面的编程 (AOP)
  3. 可靠的企业库,使持久性、事务、Web UI、服务等变得更容易。

如果所需要的只是重新安排几个类,那么就没有必要使用 Spring 了。

我认为最大的原因是它们在设计、实现和测试方面的严格性。他们编写的代码比我自己编写的代码要好得多。我发现我的项目从使用 Spring 中受益匪浅。我的认识和思维也受到了影响。

Reorganizing code doesn't provide all the benefits that Spring.NET will give you:

  1. Inversion of Control (IoP)
  2. Aspect-oriented programming (AOP)
  3. Solid enterprise libraries that make persistence, transactions, web UI, services, etc. easier.

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文