• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Spring 3 book queston

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there full support for JPA (openJPA).

 
Ranch Hand
Posts: 527
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Ranch Hand
Posts: 125
1
Clojure Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

 
author & internet detective
Posts: 41502
881
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
author
Posts: 422
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?).
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 422
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'll be hanging my head and weaping a little now. :-)
 
Michael Swierczek
Ranch Hand
Posts: 125
1
Clojure Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 527
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic