• 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
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Preferred Way of IOC Contaner Configuration?

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

I want to learn Spring Framework. I want to know which is the preferred way of configuring IOC Container:-
1. XML based Metadata
2. Annotation based Configuration
3. Java based Configuration

I want to use the configuration later on in Enterprise application development.


Thanks,
Raj
 
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
Raj,
"It depends". There isn't one best way. Sorry.

Personally, I like annotations best. I think you should try multiple ways and see what you prefer. Or ask your teammates (if this isn't isn't just for practice) since this is a project decision.
 
raj malhotra
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Jeanne,

Ok i got it. Does Annotation based configuration, as versatile as XML based Metadata?

Regards,
Raj
 
Ranch Hand
Posts: 46
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I like to use Spring Boot so that everything is just annotation based, plus a little bit of configuration in application.properties.
When needed, I do some JavaConfig to override Spring Boot's stuff or add new stuff.

I find annotations are really a great invention! And yes this kind of Spring configuration is versatile and you get errors at compile time, which is time saving. Plus, when doing JavaConfig you also get autocomplete from your IDE, so you even save more time in regards to XML config.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic