• 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 in action - Configuration styles

 
Ranch Hand
Posts: 38
Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I have read the 2nd edition of Spring in action, and I must congratulate to Craig on a great book.

I have a question regarding configuration styles.
Which configuration style would you recommend?

I am using XML style in the most of cases, but I see that annotation based configuration is widely used.
In which situation to use the XML style, and in which situation use the annotation based style?

Thanks in advance!

Best regards!
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am not sure that this is answer on your question but check this recored webinar on spring source
 
Jurica Krizanic
Ranch Hand
Posts: 38
Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Radovan,
I will take a look of that webinar.

 
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'm not sure I can tell you which style I recommend. The fact is, I don't mind XML configuration. But I also really like the @Component and @Autowired annotations (or @Named and @Inject if you like the JSR-330 style). And I have a fondness for the Java-based configuration and have used it sometimes.

The nice thing is that Spring won't force you in any specific direction here. You're free to choose which style best fits your needs and preference. In fact, you're free to mix-n-match styles within an app.
 
Jurica Krizanic
Ranch Hand
Posts: 38
Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK Craig,
thanks for the answer.

It is good to have many options available.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic