Spring DI via Java configuration. No XML!

In picocontainer you have only one option: configure your beans with pure Java code. Thats what I want. Because it is type safe and all major IDE will easily refactor this code later if necessary.

Then, with nanocontainer, it is even possible to write the configuration code in scripting languages.

In Spring you normally hook up your dependencies in an xml file. This is okay as long as you learn this ‘xml’. So, I looked around if there are alternatives to xml.

Here are the results:

2 Responses to “Spring DI via Java configuration. No XML!”


  1. 1 Chris Beams 16 July, 2008 at 01:47

    Hi Peter, if you have any questions regarding JavaConfig, don’t hesitate to post on the forums. Also, you may want to give a try with the latest snapshots for the most up-to-date features and bugfixes.

    There is currently some support for JavaConfig in Spring IDE (assuming you use Eclipse), and IDEA has support as well. When M4 is released, we’ll see a much deeper tooling integration.

    Good things to come! Any feedback you may have will be appreciated, thanks.

    http://forums.springframework.com (Post JavaConfig questions in the Core Container forum for now)
    http://jira.springframework.com/browse/SJC (to browse the latest features & submit any bug reports)
    http://forum.springframework.org/showthread.php?t=55733&highlight=javaconfig&page=2 (for info on upgrading to M4 snapshots – will be documented properly soon enough)

    - Chris

    Chris Beams
    Sr. Consultant
    Lead, Spring Java Configuration
    SpringSource – http://springsource.com

  2. 2 Peter 16 July, 2008 at 08:34

    Thanks a lot Chris for this info!
    I will definitely take a look at it for timefinder …

    PS: core container http://forum.springframework.org/forumdisplay.php?f=26
    http://jira.springframework.ORG/browse/SJC


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s





Follow

Get every new post delivered to your Inbox.

Join 191 other followers