Thursday, June 23, 2011

POJO and JAXB - Google Translate for programmers, or dangerous syncretism?

The term "religious war" is often applied to platform discussions in the technical world - Windows vs. Mac vs. Linux, Verizon vs. AT&T, etc. And with reason. At times, people get as passionate about these discussions as they do about religious disputes. As far as I know, no one has been beheaded or burned at the stake because of their platform preferences, but people have certainly lost their jobs over those issues. Sometimes willingly - decades ago, I heard a Mac fanatic tell a company vice president of engineering that if he were forced to work on Windows, he'd quit.

The same holds true of programming languages and platforms. Programming languages are akin to spoken languages - if you speak Serbian to me, an English speaker, I'm not necessarily going to understand you unless I have a special tool that allows me to understand Serbian. Similarly, I can't necessarily take my 1970s-era BASIC syntax and throw it into some other language.

Or perhaps I can. Well, not with BASIC (as far as I know). But we do have POJO and JAXB and what they can do. People better versed than I can speak on this topic, such as Dominique Vernier:

In this article, the author explains how to transform that XML response into a Java™-usable response by creating Plain Old Java Objects (POJOs) and calling JAXB's unmarshal method....

This is also addressed by numberformat, teera, Thomas Sundberg, and others.

Wikipedia explains why one would want to use something like JAXB.

JAXB allows storing and retrieving data in memory in any XML format, without the need to implement a specific set of XML loading and saving routines for the program's class structure....JAXB is particularly useful when the specification is complex and changing. In such a case, regularly changing the XML Schema definitions to keep them synchronised with the Java definitions can be time consuming and error prone.

In a heterogeneous world, tools such as this can be valuable, since they allow the XML folks to continue doing XML stuff, and the Java folks to continue doing Java stuff. After all, you can't expect the entire world to adopt a single platform.

Or can you? Here are some of the arguments from this thread in favor of a homogenous platform:

My manager ... said that he sees the inherent impedance mismatches that would happen between developer machines (possibly Linux and Windows on developer boxes) and production arising from differences in tools and platforms as far outweighing the relatively small cost of changing habits and tools....

Within the team, I would prefer a homogeneous use of configuration and IDE, since this makes it easier to get new developers started, and easier to make sure any changes in architecture or configuration get rolled out to everyone with as little pain as possible (especially since I am the one responsible for the configuration)....

The main advantage of a homogeneous environment is probably that it is easier to manage. That's good for the admins....

I have the luxurious advantage that if my machine goes down for whatever reason and I can't work - it's not my problem, that becomes the problem of the I.T. support staff and if I'm not working, they'll have to suffer the wrath of my manager. I just pick up the phone, call I.T. support and tell them my machine is hooped. When they ask what the problem is I feign idiocy like the other 99% of the staff and they come and fix it. It's great, I never have to worry about the stability of my machine or the software on it as that's not my problem which is actually quite liberating. If it does go down, I can hop on someone else's computer and carry on where I left off - using the exact same toolset as we all have the same until my computer is fixed and I don't have to waste time fixing it myself.

This is just a sampling of the comments in the thread, but I can probably overgeneralize it by saying that the workers are in favor of heterogeneous environments, while the bosses are in favor of homogenous environments.

Guess who writes the paychecks?

Of course, the workers do have some leverage in the matter. Sometimes a worker starts up his or her own company, and therefore can do whatever he or she wants - at least until the company becomes big and you have to set rules such as no iPhones for the kids. And even at the big companies, they might have to yield a bit to get the talent they want.

But the debate on platforms and platform interoperability continues, and has about as much resolution as...well, as peace in the Middle East.
blog comments powered by Disqus