Answering Sleepycat

Sunday, February 18th, 2007

Sleepycat asks some interesting questions about a non-standard persistence API they are developing. By the way, non-standard is good. Ideas like this should be tried out in open source products first before baking them into standards. I applaud Sleepycat for taking this route instead of rushing into the JCP. Indeed standardizing in advance of implementation experience explains a lot of the problems in JEE that APIs like this one are designed to replace. Anyway, on to the questions:
(more…)

Homework

Monday, February 5th, 2007

Don’t you just love students who send you their homework problems in the hopes that you’ll do it for them? Here’s the latest example I’ve gotten:

Often in reading an article, a book or a document one comes across a word whose meaning is not known to the reader. This problem can be overcome by providing an on-line dictionary so that a reader could look up the meaning of a word. In order to provide help with reading, you are asked to develop a Java Applet with the following GUI interface:

Labels Text Boxes
Word typed Text box A
Word meaning Text box B

Once a user types a word in text box A and presses return, the meaning of the word is displayed in text box B (provided that word exists in the dictionary), otherwise, the message “word not known” appears in Text Box B. Notice that both text boxes are preceded by a label. For the purpose of testing, it is expected that the developed Applet is able to cope with 100 or more English words

That’s actually not a bad problem: takes in applets, GUI widgets, event handlers, data structures, and possibly network communication (if the dictionary is stored remotely). However it’s not too complex to implement in a week. I’ll have to remember it for my own classes.

In the meantime, if any teacher recognizes this as their own assignment and wants to know where I got it, drop me a line. :-)

Compiling Javac

Thursday, November 16th, 2006

I downloaded the javac sources and gave them a whirl with ant on my PowerBook. No success. They wouldn’t compile. I’m not sure whether this is because I’m using a Mac or because I’m using Java 5, and they want Java 6. There seem to be several missing or incompatible classes.
(more…)

Interfaces vs. Classes

Tuesday, November 14th, 2006

Apparently XOM and JDOM aren’t the only projects to consider interfaces to be more trouble than they’re worth. I just noticed that JAXB 2.0 now uses singles classes for its generated files rather than separate interfaces and implementation classes like version 1.0 did. Given that these are generated code that should not be directly modified or extended by the programmer, this seems an obvious choice.

Estimated Complexity

Monday, November 13th, 2006

From the Apache Harmony bug tracker:

Unknown Novice Moderate Advanced Guru Needs James Gosling

AWT on the Event Dispatch Thread?

Friday, November 10th, 2006

Last night I was teaching my Intro Java class about Swing windows, and specifically discussing the event dispatch thread. I dutifully warned everyone that all creation and update of Swing components had to happen on this thread, usually by calling SwingUtilties.invokeLater(). Then one of my students asked a question that stumped me:

Is the same true for AWT components?
(more…)