SpringFramework’s JavaConfig…

I have to admit, I was very impressed with Ryan Breidenbach’s Spring JavaConfig talk tonight at the Spring Dallas User Group.  I don’t hide the fact that I’m a big fan of xml configuration, and very much against annotation-driven config.  However, I don’t think I have a problem with doing my bean wiring in Java.  I’ll have to sleep on it, and then look at some code and blogs tomorrow before I yeah or neah it, but I kind of liked what I saw tonight.

One of the keys behind xml config, is having a central location to see how your app is wired, and you still have that with JavaConfig.  You get stronger type safety, there is no need to cast your bean from Object, and you get built-in IDE refactoring.  Ryan did a nice job showing off a lot of advanced bean-wiring methods in JavaConfig.

If you want to learn more about Spring JavaConfig go to the source and read more at the projects homepage.

This Post Has 4 Comments

  1. Chris Beams

    Hi Erik,

    Glad to hear you liked what you saw tonight. Keep the feedback coming! We’ll have additional useful features in upcoming milestones so stay tuned…

  2. Erik Weibust

    Chris,

    I haven’t dug too deep yet on the Java Config site, but from what I saw last night. It almost looks like everything from xml config, option wise, is present in Java Config. I’ll have to check the project’s roadmap to see what you guys are working on.

    Erik

  3. peter lawrey

    We have been using java for configuration for a while using a framework I wrote. Some of the other benefits of this approach are the use of inheritance in your configuration file, debugging, code completion, and static code analysis.
    Today I need a configuration with a variable number of components to test scenarios with different numbers of clients, servers and thread pools.
    There is no simple way to describe this in XML, (Without lots of duplication) but in Java I used a for loop.

  4. peter lawrey

    BTW The thread pools and the clients/servers were all described in the same file which keeps unit testing simple.

Leave a Reply