6

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

Silvercode
  • 977
  • 1
  • 7
  • 13

4 Answers4

15

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.

workmad3
  • 25,101
  • 4
  • 35
  • 56
8
  • 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.

Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
  • 3
    "It provides an IoC container" but compared to some other IoC Containers, it can be a real pain. The config is almost always in app.config not in code, making it easy to get wrong and hard to change on the fly. – Anthony Dec 28 '09 at 00:22
  • @Anthony No, it is possible to use code config with Spring.Net (http://www.springframework.net/codeconfig/index.html). For me, I prefer xml config because it can be easyly changed during the integration test without the need to compile something. – Beachwalker Feb 07 '13 at 12:18
  • I wrote that a the end of 2009. I'm sure that in the meantime, Spring has gone some way to catching up with the rest of the pack. – Anthony Feb 08 '13 at 15:02
  • @Anthony What makes a changing code-config easier than app-config when the app is already deployed? You need a compiler for any change and THAT is a real pain, I think. So "easy" and "pain" depends on the situation. When debugging an app it's often "easier" to change a code-config but especially when doing hardware intergration steps with multiple small problems that might occur the possibility of quick changes in xml files is a huge benefit. This is especially the case for large enterprise applications with multiple project partners and frequently changing components. – Beachwalker Nov 18 '13 at 14:40
  • Since code can read config in a great variety of ways and config sources, code-config is a superset of app-config. "You need a compiler for any change" is only true if you code it that way. If you need flexibility via config, don't code it that way. There are cases where app-config (i.e. using the standard code to read config) is best, though I haven't run into many. I'm saying that having only this option is bad. – Anthony Nov 25 '13 at 09:25
3

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

Daniel Honig
  • 4,268
  • 6
  • 26
  • 24
1

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

Shiva
  • 1,379
  • 1
  • 15
  • 32
  • 2
    I'll ask what I asked on the others: What makes Spring.Net "really awesome" compared to Castle.Windsor or MS Unity? What does it to better than them? – Anthony Dec 29 '09 at 12:23
  • 1
    --Better IOC Containers --In the web app, Easy Redirection of the pages --Smooth DI (Depenendency Injection on code behind pages , business logic layer) --Easy integration with NHibernate --Support of both XML Configuration and Annotation – Shiva Dec 29 '09 at 14:35
  • 2
    What do you find "better" and "smooth" about Spring.Net's IoC with respect to this example? http://stackoverflow.com/questions/1955862/how-to-change-configs-in-spring-net – Anthony Dec 29 '09 at 18:49