Spring.Net 如何让我的生活变得更轻松?

发布于 2024-07-07 11:15:59 字数 566 浏览 8 评论 0原文

“Spring.NET 是一个开源应用程序框架,使构建企业 .NET 应用程序变得更加容易。” Springframework

他们说 Spring 使 .Net 开发变得更容易。 然后我看到了一份很长的手册。 第 5 章 IoC 容器

然后我看到一些神秘的堆栈当我运行带有 Spring 的项目时跟踪错误。 当一切都如此困难时,春天如何让我的生活变得更轻松?

编辑:错误是在我运行项目时出现的,而不是像我第一次写的那样编译时出现的。 我知道企业应用程序需要比普通应用程序更复杂的框架。 但即使在这种情况下,它们也不应该变得复杂。 我的意思是,如果我想编写一些逻辑,我不需要经历很多其他的事情。

编辑:如果我开始使用具有 Spring 的现有项目,我别无选择,只能使用 Spring。

"Spring.NET is an open source application framework that makes building enterprise .NET applications easier."
Springframework

They say that Spring makes .Net development easier. Then I see the manual which is long as anything.
Chapter 5. The IoC container

And then I see some mysterious stack trace errors when I run a project that has Spring. How is Spring making my life easier, when everything is so hard?

Edit: The errors come when I run the project, not when I compile like I first wrote. I understand that Enterprise applications need more complex frameworks than normal applications. But they shouldn't be complicated even in that case. I mean, if I want to write some logic, I shouldn't need to go through lots of other stuff.

Edit: I don't have a choice but use Spring, if I start using an existing project that has it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(4

梦断已成空 2024-07-14 11:15:59

请注意,它说它使企业 .net 应用程序变得更容易。 企业应用程序实际上与普通应用程序并不相同。 它们是非常大规模的应用程序,需要围绕大规模可扩展性、可移植性和极其灵活的配置进行设计。 简化此过程的框架仍然难以使用,但比从头开始完成所有这些工作更困难且更可靠。

不过,我对在“正常”项目中使用企业框架持怀疑态度,因为它很可能对非企业需求进行了过度设计,并且在这种情况下最终可能比从头开始编码更困难。

Note that it says it makes enterprise .net applications easier. Enterprise applications are not really the same as normal applications. They are very large scale applications, requiring designing around massive scalability, portability and extremely flexible configuration. Frameworks that simplify this process are still going to be difficult to use, but are less difficult and more reliable than doing all of that work from scratch.

I would be dubious of using an enterprise framework in a 'normal' project though, as it is most likely extremely overengineered for non-enterprise requirements and could end up being more difficult than coding from scratch in that circumstance.

百合的盛世恋 2024-07-14 11:15:59
  • 它提供了一个 IoC 容器。 是的,要充分利用它需要大量阅读。 几乎所有强大的工具都是如此。 如果您打算使用 LINQ,那也需要一些研究 - 在您看来这是否意味着 LINQ 毫无用处?
  • 它为各种事物提供了有用的实用程序类。 通常,这些是您在其他情况下可能会自己做的事情。

现在,至于为什么在编译使用 Spring.NET 的项目时会遇到神秘的堆栈跟踪错误......这听起来很奇怪。 我们需要了解更多有关错误的信息才能知道发生了什么。

  • It provides an IoC container. Yes, using that to its full requires reading quite a lot. The same is true of almost any powerful tool. If you're going to use LINQ, that needs some study too - does that make LINQ useless in your view?
  • It provides useful utility classes for various things. Often these are things you might roll yourself in other circumstances.

Now, as for why you're getting mysterious stack trace errors when compiling a project which uses Spring.NET... that sounds very odd. We'd need to hear more about the errors to know what's going on.

等风也等你 2024-07-14 11:15:59

如果你不明白,你可能不应该使用spring……

但是Spring.NET是一个很好的框架。 它不仅仅是 IoC,还有更多......
如果您不理解依赖注入/IOC 或面向方面的概念,Spring 可能不会为您做太多事情,您不妨在代码中坚持使用服务定位器类型的东西和显式的 try/catch 块......

If you don't understand, you might ought not use spring.....

But Spring.NET is a good framework. It is more than IoC, alot more....
If you don't understand dependency injection/IOC or Aspect Oriented Concepts, spring may not do too much for you and you might as well stick to service locator type things and explicit try/catch blocks all over your code....

雪化雨蝶 2024-07-14 11:15:59

我同意你的观点,它有一些学习曲线,但仅此一点不应该阻止任何人学习这个非常棒的工具。

I agree with you that it has some learning curve, but that alone should not discourage anybody from learning this really awesome tool.

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