aspose file tools*
The moose likes Spring and the fly likes Spring 3 book queston Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring 3 book queston" Watch "Spring 3 book queston" New topic
Author

Spring 3 book queston

Brent W Farrell
Greenhorn

Joined: Apr 10, 2008
Posts: 17
It seems spring 3 seems to be moving to annotations over xml for configuration. Is there an advantage to using annotations. Will the legacy xml configuration method still be supported.
Lyndon Tate
Greenhorn

Joined: Aug 10, 2009
Posts: 2
Is there full support for JPA (openJPA).

Anil Vupputuri
Ranch Hand

Joined: Oct 31, 2000
Posts: 527
Brent W Farrell wrote:It seems spring 3 seems to be moving to annotations over xml for configuration. Is there an advantage to using annotations. Will the legacy xml configuration method still be supported.


Yes, it is either-or, we can still use XML configuration file instead of Annotations.


SCJP 1.5, SCEA, ICED (287,484,486)
Michael Swierczek
Ranch Hand

Joined: Oct 07, 2005
Posts: 117
    
    1

I prefer annotations to XML because the annotations give you more compile-time checking. With XML configuration, you don't discover a spelling or misplaced node error until you actually run the application. Annotations catch many, though not all, of those kinds of errors.

Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31079
    
163

Anil Vupputuri wrote:
Brent W Farrell wrote:It seems spring 3 seems to be moving to annotations over xml for configuration. Is there an advantage to using annotations. Will the legacy xml configuration method still be supported.


Yes, it is either-or, we can still use XML configuration file instead of Annotations.

Or both. You can use a mix of XML and annotations. For example, you can define beans in the XML and autowiring via annotations.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Craig Walls
author
Ranch Hand

Joined: Sep 19, 2003
Posts: 335
    
    5
What Jeanne said...

It's not either-or. I tend to favor the annotation-based wiring. But even so, it has its limits (How could I wire a 3rd party class as a Spring bean using annotations?).

Spring in Action - Unleash POJO power in your applications!
Modular Java - Discover the secret weapon to modularity on the Java platform!
XDoclet in Action - Your complete guide to code generation with XDoclet.
Ben Logan
Greenhorn

Joined: Feb 13, 2010
Posts: 12
Craig Walls wrote:What Jeanne said...

It's not either-or. I tend to favor the annotation-based wiring. But even so, it has its limits (How could I wire a 3rd party class as a Spring bean using annotations?).


I worked with a guy so opposed to XML wiring than he used to wrap 3rd party classes and annotate the wrapper!

Each to their own, I suppose.
Craig Walls
author
Ranch Hand

Joined: Sep 19, 2003
Posts: 335
    
    5
I'll be hanging my head and weaping a little now. :-)
Michael Swierczek
Ranch Hand

Joined: Oct 07, 2005
Posts: 117
    
    1

Ben Logan wrote:
I worked with a guy so opposed to XML wiring than he used to wrap 3rd party classes and annotate the wrapper!

Each to their own, I suppose.


Okay, I admit it was tempting, but I've never gone that far.

I'm sick of XML - not that it matters, I wouldn't be surprised if I'm still wrestling with it at work in 30 years - but the one colossal advantage it has over annotations is that you don't need to recompile anything to change it.
Anil Vupputuri
Ranch Hand

Joined: Oct 31, 2000
Posts: 527
Jeanne Boyarsky wrote:
Anil Vupputuri wrote:
Brent W Farrell wrote:It seems spring 3 seems to be moving to annotations over xml for configuration. Is there an advantage to using annotations. Will the legacy xml configuration method still be supported.


Yes, it is either-or, we can still use XML configuration file instead of Annotations.

Or both. You can use a mix of XML and annotations. For example, you can define beans in the XML and autowiring via annotations.


Yes, you are true. I forgot about it. Here is another discussion going on XML config vs Annotations
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring 3 book queston