RoboGeek

RoboGeek's (David Herron) Weblog: co-developer of Robot and several other things related to Java testing.


« arsTechnica on AJAX | Main | Pure Java podcasting »
20050825 Thursday August 25, 2005

The value of having XML built into the language A few days ago a javalobby thread asked if Java should go on a diet.  One of the culprits for their perceived bloat was the inclusion of XML libraries in the Java platform.

I'm not going to try and defend the inclusion of every one of the features in Java.

But let me share something .... I'm in the middle of writing a perl script to scan a directory structure and print out some data.  I want to format the data in XML because it's so easy to manipulate XML later.  I want to do it properly ... build a DOM tree, then serialize it, so that I don't have to worry about encoding issues if I were to hand-build the XML.

But, the perl installation available to me doesn't have XML built in.  To get XML::DOM to work I need to install several other packages.  Since I don't have write access to the perl installation (I'm not the super user in this case) I have to install outside the normal CPAN ritual, which meant stumbling through the perldocs to find the one paragraph that described how to install a perl module in the nondefault location.

You know what?  This rigamarole is ridiculous!!!  XML is such a core part of the modern computing environment.  For XML to be excluded from the core of any language today is ridiculous!!!

Why a perl script?  Java could do the whole thing right off the bat ... you set up the BuilderFactory etc, make a Document object, start filling it in, etc, it's all trivial and you don't have to worry about any encoding issues.  Unfortunately I want to record the file ownership and Java doesn't currently give you access to the file ownership, whereas perl does.
(2005-08-25 14:58:56.0) Permalink Comments [3]

Trackback URL: http://blogs.sun.com/robogeek/entry/the_value_of_having_xml
Comments:

File permissions are such a core part of the modern computing environment ...

Posted by Matthias on August 25, 2005 at 10:48 PM PDT #

Yes, I agree (***sigh***)

See bug #6309963 which I filed a couple weeks ago.

Posted by Robogeek on August 26, 2005 at 10:06 AM PDT #

Oops, I forgot to make the other comment I wanted to say.

Namely ... first, support for file permissions are being added in Mustang (1.6). Second, the only excuse I can come up with for the lack of reporting file permissions and ownership is that not all platforms support the concept.

I remember there being a similar argument around the lack of a chdir equivalent in Java. Would chdir apply to the whole process or just to the thread that called it? If it applied to the whole process, then how do you notify the other threads they're in a different directory now? What about operating systems that don't support chdir for just one thread, or force chdir to be per thread?

For file characteristics, there's some variability in what different platforms provide. Working with perl yesterday refreshed my memory of what you get back from the stat(2) system call, and how that data just doesn't apply to a different OS. Java's raison d'etre is to support cross platform computing.

So, today I'm asking for info on file ownership and permissions, would someone want to know the number of links to the file? Or the "device" and "inode" associated with the file? How many extra file characteristics should be exposed?

You'll note in the bug report that the evaluator says there's a JSR, JSR203, working on this. It says the JSR update will be delivered as part of Mustang.

Posted by robogeek on August 26, 2005 at 10:17 AM PDT #

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed