periyasamycse — 2010-02-03T21:29:47-05:00 — #1
can any one explain about why spring is called as Light weight component.
Thanks in advance.
kevinyank — 2010-02-03T23:40:38-05:00 — #2
"Lightweight" is one of those overloaded terms that can mean a lot of different things.
In Spring’s case—and please keep in mind that I am not a Spring expert—“lightweight” seems to mean a departure from the configuration/boilerplate-heavy style of previous Java web development frameworks.
Frameworks like Struts 1 involved writing lots of XML configuration files, classes full of “do nothing” code, and a complex directory structure for packaging applications. Spring, on the other hand, does its best to save you from having to repeat yourself in your code, and relies on naming conventions to reduce the number of configuration files needed to hook things together.
In theory, this reduction in code complexity will also come with improved performance, because applications are “lighter”—thus the term “lightweight.”
Someone, please, correct me if I’m wrong.
hooknc — 2010-02-04T11:00:24-05:00 — #3
Don't forget that Spring's main purpose was to introduce Dependency Injection for objects.
Meaning now, that your objects do not need to know how to go get their collaborators, the collaborators are just set on your objects via Spring.
BTW, all that naming convention stuff for spring and its MVC framework is not as easy as it sounds... to debug. When something goes wrong, it can be quite hard to figure out what is the culprit.
adiian — 2010-02-08T12:36:38-05:00 — #4
Maybe because in the beginning it was lightweight... Then it grew, it grew and continues to grow.
sg707 — 2010-02-18T14:40:12-05:00 — #5
I have used Spring for years and I don't quite get why it would be called "lightweight" components. As hooknc said, Dependency Injection is what makes Spring very popular! It helps the coders to write less and make it more flexible and etc... In the core of Spring, it acts as an "Integrator" among different library implementations. Of course, it has other things like Spring MVC, Spring Web Flow, Spring AOP, and etc... and they have nothing to do w/ the concept of "lightweight".... Honestly, like you I truly don't understand what they mean by "lightweight". But, from my understand is that if you use J2EE stack then it's considered "heavy weight" because you have to take all or nothing approach. "lightweight" seems like you can pick and choose the components you want to use..therefore it's "light weight"... Maybe that's what it is or not.. In any case, Spring is awesome!!!!!!!!!!!!!!!!!!!!!!!!!!!!