File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Application Frameworks and the fly likes Justification of using Spring Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Reply Bookmark "Justification of using Spring" Watch "Justification of using Spring" New topic
Author

Justification of using Spring

Silvio Esser
Ranch Hand

Joined: Nov 05, 2005
Posts: 57
I'm trying to using Spring in my design for a web app,
but the manager wants me to justify it. I need Spring
promoter's help.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56200
    
  13

If you need help justifying it, why would you want to use it? If you can't come up with any good reasons on your own, perhaps your manager is right?


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Hanuma Deepak Muvvala
Ranch Hand

Joined: Nov 20, 2005
Posts: 157
Tell your manager about IOC, AOP which are great features of Spring and not available in new J2EE Technologies...

Deepak......


Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56200
    
  13

"Deepak", please check your private messages.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56200
    
  13

Originally posted by Deepak:
Tell your manager about IOC, AOP which are great features of Spring

But what do these patterns bring to the application? Why is it desirable? And is Spring worth it?

and not available in new J2EE Technologies...

Nonsense. Spring is written in Java like everything else. These patterns, if desired, are available to everyone.
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3359

Tell your manager about IOC, AOP which are great features of Spring and not available in new J2EE Technologies

Java EE 5 is built on the idea of IoC and EJB 3 is shipped with AOP (maybe not as rich as Spring AOP, but it serves you well).
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14672
    
  11

If you cannot justify it yourself, it's probably not worth it. I agree with the others that you should not go for Spring just for the hell of it. But if you want to check what it can help you to achieve, check out this overview. This recent article may also interest you.
[ November 12, 2007: Message edited by: Christophe Verre ]

[My Blog]
All roads lead to JavaRanch
S. Palanigounder
Ranch Hand

Joined: Apr 03, 2003
Posts: 145
Another issue about Spring is the performance.

The quickest way to create an instance of a class is to use "new" operator directly. You can apply some GOF patterns (Factory, Builder, ...) to
organize code better.

The slowest way is to use Java reflection, which Spring uses.
Herman Schelti
Ranch Hand

Joined: Jul 17, 2006
Posts: 387
hi S. Palanigounder,

can you tell us where Spring uses reflection, and at what cost compared to the faster methods you mention?

Herman
S. Palanigounder
Ranch Hand

Joined: Apr 03, 2003
Posts: 145
When you define a class in applicationcontext.xml, something like:

...
<bean id="myDAO" class="com.work.MyDAOImpl" />
...

How does Java create an instance of com.work.MyDAOImpl using the data in
the xml file?
Herman Schelti
Ranch Hand

Joined: Jul 17, 2006
Posts: 387
hi S. Palanigounder,

thanks for your reply.


But you did not answer my question about the performance cost of this, especially since Spring usually only has to create 1 instance of this class.
Can you post some numbers?

Herman
[ November 17, 2007: Message edited by: Herman Scheltinga ]
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3359

Yes, Spring uses reflection but not reflection facility of the JDK, AFAIK, it uses the open source counter part (I'm not sure which open source project), but it is performant.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Justification of using Spring
 
Similar Threads
OSGi & Equinox : Spring DM
JSP Combobox and Java Class
Frameworks
Custom authentication
Eclipse error : Declared package does not match expected package