Navigation

RSS 2.0 New Entries Syndication Feed Atom 0.3 New Entries Syndication Feed

Show blog menu v

 

General

Use it

Documentation

Support

Sibling projects

RIFE powered

Valid XHTML 1.0 Transitional

Valid CSS!

Blogs : Archives

avatar
< Which template syntax looks best to you?   RIFE Fosdem Conference Video >
What's with all the XML hatred lately?

A part of the Java community seems to have a serious case of the anti-XML disease. Anywhere they see a snippet of XML they immediately condemn it, torch it and rip it to shreds without looking at the meaning and the purpose. Hell, it's XML, so it must be bad and totally inappropriate. It's obviously bloated, not needed, over-architected and not offering anything worthwhile besides configuring items that nobody wants to customize.

People, XML is just a language. True, it has been abused a lot in the past, and so have many other things in your development toolkit. The key message here is separation of concerns. I guess we pretty much all agree on the fact that you don't want a single agglomerate of code where all possible concepts bleed together into an unmaintainable mess. Otherwise we would all still be writing pure JSPs with scriptlets that perform direct JDBC access, view handling, and direct data manipulation without any kind of domain model right there.

I don't care the tiniest bit about XML itself, but I do care about reusability, maintainability, clarity, consistence and de-coupling. I want to express contextual information that is not related to the actual logic of my components somewhere else. I also don't want to have to change my components when I reuse them or when the context in which they are used evolves. Intelligibly externalizing all the 'glue information' might be a small overhead to pay initially, but I've always been very happy that I did a few months further down the road. Remember, development is not solely about getting somewhere to fastest way possible. You wouldn't be using patterns like MVC, IoC, Service Locators, ... then, would you?

I strongly urge Java developers to look at the purpose and the meaning of the XML that they're about to crucify, and by that I mean the larger scale, long term benefits and not just the additional overhead of an overly trivial example. Consider what you gain from all the provided facilities from a maintenance and team development perspective. Isn't that what you do when you evaluate a Java API too?

Finally, XML really is just a language, I've successfully replaced many declarations with other languages like Groovy, Janino or even pure Java. Check if the underlying builder APIs are consistent and well designed, and look past the brackets, the tags and the arguments of what is often just a facade. It's a shame to judge a entire technology stack by the frustration that has been associated with something as trivial as a declarative language.

posted by Geert Bevin in Java on Feb 22, 2006 9:59 AM : 6 comments [permalink]
 

Comments

Re: What's with all the XML hatred lately?
I don' t think I helped with my comment on TSS :$

Personally, I don't mind xml itself, but watching the rife demo video, I began to lose track of which xml files needed to be edited to get things to work. I like to automate as much as I can when I develop and I like to spend as much time working on java code in my ide than working with xml.

I think the problem isn't with the technology, its tool support. If the tools are good, and hide as much of the underlying technology then people won't complain as much! I had to use ATG on a project a few years ago and they use properties files very heavily to achive a concept of layered configuration, something that is now possible using spring and xml. The difference is that ATG provided a tool (command center i think they call it) that hides the complexity. An application could be wired up graphically, very quickly and the whole process could be easily explained to other developers.

IMO the biggest problem that the java community faces isn't a lack of support, but a lack of coherence. With so many groups pulling in different directions, tool vendors can't/won't make the leap to support our frameworks. It is incredible that in '06 we are still wiring up applications in xml across multiple layers by hand!

BTW, still trying to get into RIFE, theres a lot to like in there, if I could just get past the view technology ;) BTW, my call for the views is using xml namespaces as facelets does.
Re: What's with all the XML hatred lately?
Hi analogueboy, I agree that tool support is a nice bonus, and that you probably have to take a moment to grasp the concepts in the RIFE declarations before you understand what's going on. Once you're past that, and not developing a trivial application, you'll start to see the benefits of the externalized declarations. Don't get me wrong, I sometimes curse myself when I need to add another tag for something to work, but at the same time I know that I don't want all the features that this provides to go away and I'm very regularly extremely glad with the setup during the evolution of my projects.

There are people working on tool support though, and a visual editor for Eclipse is well underway: http://rifers.org/blogs/gbevin/2006/1/13/visual_rife_eclipse_plugin

That should make things even more comfortable.
Re: What's with all the XML hatred lately?
I think most programmers don't want config GUIs. Some do, and it's nice to have them as an option for places that require such things.

I think Eclipse is why people don't like XML. Its XML support is terrible, but its Java support is great. So if you emphasize APIs and let people write a separate config class (and if class reloading in Java were better), then Eclipse lets you live in happy Java land.

Maybe if Eclipse XML support gets better (or if NetBeans Java support gets better so more people want to use it), then XML configuration might become less of an issue.

But as you say, if you have stable APIs you should be able to appease both crowds at the cost of a more complicated marketing message.
Re: What's with all the XML hatred lately?
Eclipse's lack of xml support might be part of the problem, but it doesn't explain all those xml bashing just lately. Imo there are at least two more major influences to note:
- the RoR / Convention over Configuration hype (I like the idea, but only where it fits)
- the real fast adoption of Tiger annotations, rapidly providing alternatives for originally xml based configuration (Hibernate, Spring etc.), sometimes leading to the misunderstanding that xml must be obsolete (which is not the case)
I still like my well defined xml configuration, besides useful annotations and stuff. And I work with IDEA, which makes writing xml really easy...
Re: What's with all the XML hatred lately?
The problem with XML is that every schema is it's own DSL where you usually none of the language features you get from a regular language.

Every XML file has it's own quirks (the same could be said of API's) but usually a language like Java is more predictable.

You end up having to learn all these new DSL's and everyone seems to want their own XML format, so suddenly you're editing web.xml, spring-beans.xml, hibernate xml, ehcache xml ad infinitum.

In some cases you can't get away from the XML at all (i.e. it's not just a facade) e.g. any J2EE descriptor and ehcache.xml (that really annoyed me). In the cases where you can replace the XML, most time you're suddenly into No Documentation No Support land (i.e. mails to lists are usually followed with comments like: our XML format is the best in the universe, only a fool would want to avoid it, puny human our great intellect is beyond your ken)

some xml i do like:

- when used for marshalling data
- when you only need one xml format to bind them all (spring config)
Re: What's with all the XML hatred lately?
A big problem with XML is the widespread use of DTD:s and schemas. The problem being that DTD:s and schemas are fundamentally flawed in their focus on order of elements. Why should it matter if I declare session-type before transaction-type or the other way around?

Add a new comment

:) ;)
=) :-)
:'( :(
:/ :D
:| :p
:o 8)
Your email address will not be displayed at anytime on any page.
Only provide your email address if you'd like updates on this entry
and it's comments by email.
Please answer this simple math question:
18 + 6 = 
 
 
  

Manage subscription

Remove email:
 

< Which template syntax looks best to you?   RIFE Fosdem Conference Video >
 
 
 
Google
rifers.org web