I was going through the Spring Java Config page.
It says
Though the project should now be considered 'decommissioned', the resources herein will remain indefinitely for posterity's sake:
Does that mean it is obsolete? Does anyone use it in their projects right now ? Does it have any advantage over conventional xml configuration?
While the Spring Java Config project has ceased (the webpages remain up just to keep links active) the results of that project have been folded into the main Spring project as of Spring 3. Thus you should not use the Java Config project's annotations for new code, but rather instead the standard @Bean
and @Configuration
(and @Value
, etc.) annotations.
So long as you use Spring 3, you can use @Configuration
and @Value
in the same project as XML configuration. I am doing this and it works really well for complex configuration problems. (I mostly prefer to use XML configuration still, as that gives better support in SpringSource Tool Suite, but for cases where you need to get the name of a class to instantiate for a bean from a property — hey, it's tricky! — then XML config doesn't cut it.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With