Saturday, December 09, 2006

Myth Buster: Spring is XML Hell

This one covers some stuff we're already doing: breaking up configs by area, using import tags, etc.
Ben does cover some things I didn't know, using factory beans. He, even recommends NOT using Spring to configure domain objects and every single bean. More, he says they recommend keeping Spring usage to dependency injection.
Another good technique, over-ridable default values in beans and factories.

Next is the parent/child bean definitions.
I've actually used this one a bit. It can make the config a little more difficult to read but, it definitely reduces the redundancy in configuration files.

Next, what I came here for: XML Namespaces
This is much cooler. There a many pre-configured tags for common cases like AOP, JNDI lookups, EJBs, autoproxy, etc. Ben then goes on to describe how to create custom namespaces.

The last subject is more about how to manage the configurations instead of reduce them. Tools.
He gives a little more demo of the Spring IDE. I'm going to have to give it another try. A couple of years ago, it didn't seem very useful but now, it appears to work very well. Informative warnings, auto-complete, what else could you want?
How about a bean viewer that shows dependencies across files and can show an object graph that looks a little like a class diagram.

This developer is impressed.

Answering a question Ben points out that auto-wiring is not really a good way to deal with the configuration files due to the loss of metadata. I'll buy that (of course, I'm not a big autowire fan anyway).

Much like his earlier session, he uses JUnit alot while changing code. Its nice to see stuff really work.

Links to this post


Post a Comment

Subscribe to Post Comments [Atom]

<< Home

Links to this post on:

Create link here by posting on Blogger