The moose likes Spring and the fly likes Spring - Basics Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring - Basics" Watch "Spring - Basics" New topic

Spring - Basics

Bhairava Surya
Ranch Hand

Joined: Aug 19, 2007
Posts: 48
Hi All,

Can someone explain me why Sping? (I have gone through so many online tutorials but not happy)
when we should use this??
In a J2EE application at what tiers/levels we can use this??

Thanks & Regards,
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

A list of benefits. And Spring can be in any or all layers that you want.

1) Makes you write POJO classes by adding enterprise abstractions through configuration rather that directly in your code
2) Manages your instances for you, meaning you only need one instance of a Business Service class to support many clients/threads at the same time.
3) Decouples your code so you can swap and change implementations without changing code.
4) Simplifies writing Unit Tests, since you objects are loosely couples and POJOs. Saves you a lot of time writing tests.
5) Allows you to get enterprise integration of Transactions, Security, etc in any environment. Does not require you to be in an App Server, you can deploy anywhere and get those benefits.
6) Simplifies API/specs like JMS, JMX, RMI, Web Services. and JDBC. Removing all the boiler plate code you would have written yourself. For example JDBC, straight JDBC requires a minimum of 17 lines of code just to run a single query. With Spring that is now just one or two lines of code.

Those are a few benefits.


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: Spring - Basics
It's not a secret anymore!