[ZOIS] Home Page * Contact ZOIS * Search * Table of Contents * Open OLTP News

A Java Clock and Some Lossages

This page is part of a critique of EJBs, demonstrating that Java can be a bit of a moving target. Originally produced as a revision exercise in coding Java, the clock Applet demonstrates some lossages in older Java Virtual Machines (JVMs).

[If Java was running in your browser an analogue clock would appear here]

A Java Clock

We have all, one is sure, waded through books styled Power Java for the Very Stupid Made Easy with a CD or thereabouts. Satisfied that enough Java had been digested to get by, there was then a hiatus where no Java was written. Since some time has now elapsed, and we are all into Enterprise Java Beans (EJB) now this clock written as revision exercise. Initial attempts at compilation were marked by the Java Compiler whinging about "Deprecated features". So the Classes and methods were rewritten to use pure Java 1.1. The interesting thing about the clock is that it has shown up some lossages that can reasonably be expected from arbitrarily trying to run more modern Java programs on Browsers which might not be all that up to date. It should be noted that the latest Java is now 1.2 (also known as Java 2).

The clock might not be telling the time very accurately, the guts of the program is the Calendar class, which is relatively new in Java. Sadly therefore the following lossages have been observed:

Clock displays a random time:
The Browser's Java implementation is ancient and can't get the time from the operating system correctly.

Clock displays a random time (and doesn't update):
The Browser's Java implementation is ancient and has a broken Calendar class.

Clock displays the time, but is an hour out:
The Browser's Java implementation is relatively modern, but is running on UNIX (or similar) and the Calendar class doesn't understand the concept of daylight savings time in the Time Zone Environment variable (in-spite of what the documentation says).

Your Browser spits out something incomprehensible about an exception:
The Browser's Java implementation doesn't understand a class invocation (probably the Point class). It is truly too ancient for the clock, you'll have to get your time some place else.

Your Browser dies trying to display this page:
Your Browser's Java implementation is so broken that it fails on startup and brings the Browser down with it. Let me guess: Netscape distributed with Red Hat Linux 6.0. You may have already figured that and switched Java off to view this page.

In these instances ancient is defined as that which is earlier than Java 1.1.4 or thereabouts. Mail Mr. OLTP if the clock did something different to the above in your Browser. We will add it to the above list (with an attribution if you wish).

A number of you out there (well, one at least) have asked to see the Source Code for the Clock Applet. We're happy to publish it in the hope it may encourage more Feedback.

$Date: 2008/07/03 15:36:36 $


Break Frame * Site News * E-mail Webmaster * Author * Copyright