Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alternative to XML-style objects in Spring configurations?

Tags:

java

spring

Spring's IoC framework is pretty nifty. Writing configuration objects in XML is not.

Are there any alternatives to loading complex objects and injecting them into your beans in Spring? Property files are too simple (they contain only key-value pairs). I'm interested in building lists, maps, etc. I was thinking something along the lines of a JSON object.

like image 793
jabalsad Avatar asked Nov 04 '22 05:11

jabalsad


1 Answers

Starting with version 3.0, and further enhanced in 3.1, Spring now has complete support for Java-based configuration.

http://static.springsource.org/spring/docs/current/spring-framework-reference/htmlsingle/#beans-java

http://static.springsource.org/spring/docs/current/javadoc-api/org/springframework/context/annotation/Configuration.html

like image 146
Chris Beams Avatar answered Nov 07 '22 20:11

Chris Beams