Archive for September, 2002

JSF

Thursday, September 12th, 2002

The Java blogs seem to be very focused on Java Server Faces recently. There’s a post on the ::Manageability:: blog, whichhas a pretty good attack on the whole JSF spec [and the Jakarta coders].
“You can’t trust the apache guys to do this, just take a look at Struts and the TagLibs, they all suck!”
As a Taglib author I have to get defensive and wonder how writing libraries to the specification could be seen as a sucky thing to do, unless they suck as taglibs. But for all I know, custom taglibs came from Jakarta people at Sun. First I’d heard of it though.

However, it does echo a theme in my head and in some blogs recently. The JSR process seems to take good technologies, create a standard that is not as powerful and not as full-featured, because it’s a standard the original project then dies, and the weak JSR takes over. JSF would seem, from ::Manageability:: to be another case in point.

When will JSR’s involve a functionality step forwards, and not a sacrifice of power to get agreement???

Interesting ZDNet article

Thursday, September 12th, 2002

A colleague of mine pointed this article out to me. It makes for interesting opinion on IBM vs Sun over Java. The whole money-making vs openness of Java is a painful thing at the moment. JSR’s seem quite closed, Sun seem to standardise existing techs and destroy those projects, ORO Regexp, Log4J and Quartz being cases in point.

Why should I bother to use Log4J when JDK 1.4 becomes standard? I like the work, but I’m not stupid. Using standard’s makes sense. However Sun’s standards always seem weaker than the things they emulate, is this due to their creation by committee? Or is it just a publicity thing. The projects being standardised propagate the weakness of Sun’s version as a myth?

EJB 2.1 has a timing service now. So what use for Quartz? It’s all quite frustrating. Compare it to an open SDK like CPAN, where modules compete and are community standardised. The best wins and becomes the standard. With Java, the best wins we hope, and get JSR/Sunnified. Take IBM’s Logging framework, which I think became the start of the JSR for java.util.log. It was arguably not the best, but was the won that can be considered to have won. Log4j bits were integrated, but did we get the best of both worlds? A super logger, or just a committee-built flop?

Are the JSR’s the Java equivalent of an EU meeting, with large organisations like Sun, IBM, HP, BEA and Apache sitting there fighting for a bland solution.

Oracle irritation

Thursday, September 12th, 2002

We discovered a need to store Timestamps in Oracle with millisecond accuracy. Until now we’d just been using a DATE field, which doesn’t have this ability, so we switched that in the database to a TIMESTAMP(3) field. Prompt TOAD quickly dying.

Looking on the Java side, it’s almost as bad. getObject returns an oracle.sql.TIMESTAMP object, which doesn’t inherit Date or Timestamp as you’d hope. setObject and setTimestamp both treat the field as if it were a DATE field, so no dice and no milliseconds. getTimestamp does however work.

So generic code is screwed, and to put a timestamp in you have to use:

((oracle.jdbc.driver.OraclePreparedStatement)ps).setTIMESTAMP( 4, new oracle.sql.TIMESTAMP( date ) );

where date is a java.sql.Timestamp. Not very impressed. As far as I can tell, this is with the latest drivers and Oracle version, 9i. Will have to check out commercial drivers tomorrow.

JSTL Article

Wednesday, September 11th, 2002

Woo. My article on JSTL was published.

This was the first article I wrote simply describing someone elses technology, so more in the way of research and pre-planning was required. Watching all the other JSTL articles and books get released from more experienced writers was quite depressing too, and having my wife’s illness helped it get pushed further back.

I got some good comments though, which is very nice. The E-Newsletter team happened to send out my tip on using jstl:include earlier in the week, only the comments are viewable online I believe.

Perl 6/JSR

Tuesday, September 10th, 2002

I’ve been reading/am reading the Perl 6 Apocali from Larry Wall and Exegesi from Damian Conway. Larry Wall writes about the new version of Perl chapter by chapter as it relates to the bible of Programming Perl [and gets himself a ready made new edition in the process…] and then Damian Conway writes a repose on that detailing just how it is useful and will affect Perl users.

I have a love affair with Perl, I frequently fine myself spending nights wrapped up reading about cool aspects, only to return to Java for the important reasons. It pays, it’s nicer to work with in teams, it seems to fit better in business currently.

Perl 6 looks to be more of the same. Some damn cool ideas that make my mouth water. All variables are objects [with the usual primitive optimisation, but not the cockup of Java of forcing them to be primitive] and have indistinct properties you can add in addition to their attributes. Think of notes in UML. But then Conway comes along and suggests these notes might be things like ‘inherits’ or ‘constant’, and suddenly the language is turned upside down. OO where everything but the objects and relationships between objects [not classes] are features of an object. New operators, the operator becomes an Iterator and not a FileReader. They’re just so good at thinking of new ideas.

I wish the JSR’s could learn from Wall et al. Open standards are nice, but open discussion is nicer. Or at least good summarising. I love reading about Perl 6, but if I goto look at the JSR’s at the JCP, I’m lucky to find a stodgy PDF at best. More likely I’ll just find a single page highlighting the idea, but not showing me anything about progress, arguments etc.

I can only put this down to big business wanting to keep the control of Java behind closed doors. Must try and find a JSR I care about strongly someday and see if I can join. A case in point is the JSTL JSR. I had some suggestions to make here, but the only interaction was to mail an email with them but never hear anything back. It gets boring :)

Java is the monolithic kernel? A large centrally run system, which works well for groups, a la Jakarta. Perl is the microlkernel. Idle for single entities and yet still forms a working federation. [I know nothing about kernels. I suspect my analogy sucks]

String taglib

Monday, September 9th, 2002

Latest edition of the Java Pro magazine has an article detailing the Jakarta Taglibs. Nice to see the String taglib get a mention, last article I saw on them [OnJava.com I think] was authored before it was released.

Nice that the JavaPro one lists the String taglib as one of the Core taglibs :) I think in functionality it is, but it lacks the age of many of the others. Thanks to Commons-Lang, String taglib is getting maturity from two directions, so hopefully it’s rapidly stabilising.

Sadly I’ll be smashing that stability to merge many tags together. A few posts to the Users list have made me realise that the String taglib is rather large currently so tags like <str:rightPad> will become <pad target=”right”> or some such. Left and Center would merge in or something. I’m still detailing the likely tags with a couple of power-users.

JDK oddity

Sunday, September 8th, 2002

An odd thing was pointed out on a website I frequent, java.lang.String.compareToIgnoreCase. The Javadoc here says:

This method returns an integer whose sign is that of this.toUpperCase().toLowerCase().compareTo( str.toUpperCase().toLowerCase())

So the person’s question was… Why???

Why uppercase, then lowercase. Why not uppercase.

I am assuming it must be due to internationalisation, turkish i’s, german double s’s, or greek sigma’s etc. Something with a weird deal with the capitalised version. However, this seems a bit weird as the method makes a note that it is not suitably internationalised, so why bother to handle just a couple of i18n’d variants.

Ideas welcome….

VIM

Sunday, September 8th, 2002

I’ve been using Vi for.. well for ages. I guess if you count using LP-ed a lot, then it goes right back to late 94. Vi itself I probably first encountered in 95. Anyways, I’m at home with it. I spent some time trying to make neat Unix scripts and vi scripts so I could code better Java, but was lured away to Intellij’s IDEA by work. However, a chance happening took me to www.vim.org to get the latest version for my clean laptop.

It just so happens that they have a new website, with easily accessible tips and scripts. Oh my. Check out this list. Java scripts. I’ve been putting some into my .vimrc etc, it’s a pain learning the stuff behind vim to put them in, but I’m nearly there.

The Apple doesn’t seem to like Vim wanting to use the meta character. So I’ve been abusing Ctrl until I figure things out. But I get nice underlining of keywords, I can autogenerate bean methods [I modified the style of java to suit me, need to learn enough vi-script to improve this one], and I can autogenerate the javadoc chunks.

There’s an import fixer which I need to learn how to hook in. Then a hyperlink thingy that will let me click on the name of a class and goto that file.. and on and on.

The arrival of Intellij and Eclipse may have briefly had Vim rolling for me, but as neither runs over an ssh session to my servers, or on OS X [IDEAs latest version demands 1.4, Eclipse’s OS X is still beta], Vim has come bouncing back.

Mac Extended

Friday, September 6th, 2002

Reinstalled with the Mac Extended FS and it flies again. The install under UFS took whole evenings per CD. With ExFS it takes a mere half hour per cd. So much so, that when I forgot to change my username to ‘hen’, I just reinstalled again.

So now I get to rebuild my laptop, and realise how few of the many applications that were on it, or demos, that I actually even use.

UFS

Thursday, September 5th, 2002

Last couple of nights have seen a good 8 hours reinstalling OS X. On UFS. Because I was sick of OS X being a) case insensitive, and b) applications like Stuffit shortening the length of filenames [I was wondering if that was HFS fault].

One very expensive [in time] lesson later. UFS really is that slow isn’t it.

Project for the weekend: Reinstall OS X on HFS.