Mike has written his first bile (although a bit more tame than Hani): Groovy scripting madness – don’t get fooled!
There certainly seem to be a lot of blog entries on how XML is suddenly evil, and that we need to move to something else instead.
As with everything there are pro’s and con’s involved here.
I like Groovy when…
I really like moving away from XML as soon as I need some kind of logic. An obvious example is Ant, and the build.xml file. If you want to do a simple if() test you have to have a target which sets up properties, then have targets with the right depends=”" and if=”property”. What a hack.
I much prefer being able to have the power of a real agile language here. I can modularize my build system as much as I want (not just with <import> and co.)
I like XML when….
XML isn’t suddenly evil. It is often a good choice for a document format. We have lots of tools that can work on it, and if you keep your document fairly simple then you won’t be in tears just because it has angle brackets.
It *does* go crazy when you look at documents that use 10 namespaces, and especially when people try to write programming languages out of it!
So, in the Spring example, I agree with Mike. There isn’t enough of a difference for me to care. I don’t tear up at the sight of angle brackets, so why do something else. If the requirements change and I need to do some smart things with the xml I have the choice of:
a) Writing something that builds the xml file
b) Use something like Groovy where it kinda IS the xml file