« First post | Main | Barclays, ABN Amro, and IT »

IBM Websphere Integrated Developer recursion

At my current client I am using IBM's Websphere Integrated Developer (WID) toolkit. It's basicaly an Eclipse with a massive load of plugins (It comes on 6 (!) installation cd's!).

Among all the things it allows you to do, is that it can create Business Objects based on a database. You point the WID to a database, select a few tables, and for every single one it generates a JAVA class.

I am a big fan of recursive tables, to keep database designs simple and efficient. For instance, think of a database model of a family tree. There you will have Humans (me, dad, mum, brothers, sisters, etc...), and Relationships (marriage, affair, etc...). Every record in the Humans table will have an ID, and 2 parent ID's, pointing to the biological parents of the person. Both those records will have 2 parent ID's each as well. Untill you reach the first person in a given tree.

In JAVA it's very simple to map this. All you do is define a class, and you give it 2 properties (parent1, parent2) and give them the same type.

public Class Human
{
    Human parent1;
    Human parent2;
    BigDecimal id;
}

Now, the WID doesn't work like that. It does almost everything in XML. In my opinion they've done just what Spring has done as well: taken out all the spaghetti code, and made it into spaghetti XML. Totaly overdone. One thing they forgot, however, is: recursion.

A class is defined by an XSD (XML) file. For every property of the class that is a complex type (another class) it defines an include for the XSD file for that class. If you have classes with circular dependencies, like the very direct one shown above, it will include itself. Which will then include itself again. Etcetera etcetera etcetera. Untill a Stack Overflow occurs.

I'm amazed that such a basic thing is such a problem in a flagship product of a company like IBM.

TrackBack URL for this entry:
http://www.stanzilieri.com/mt/trackback/16

Comments (1)

Imriyr [TypeKey Profile Page]:

Hahahaha, that's just plain stupid! :D

It's not only amazing that this is a problem, it's embarassing for IBM. :)

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About

This page contains a single entry from the blog posted on February 20, 2007 11:09 AM.

The previous post in this blog was 'First post'.

The next post in this blog is 'Barclays, ABN Amro, and IT'.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.34