Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring - Basics

 
Bhairava Surya
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
Ravi.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic