My friend Jon writes an interesting blog on the problem of constructors, and how a language might improve on them - and comes to a fairly startling solution.
The major problems with constructors as I see it are
Especially in deep inheritance hierarchies, or when you inherit from a class in a library which could involve incompatibly, it is easy for your object to be called when it is in a not-...
on Mar 31, 2009
font-family: arial, helvetica, sans-serif;
margin: 8px 0px 5px 0px;
on Feb 20, 2009
One cannot call oneself a Java geek if you haven't done JVM crash dump analysis. I mean, a C programmer would laugh at you if you tell them you don't know how to look at the stack dump. Well, I just had the pleasure of doing an analysis, so I'll show you how to do it, in case you don't know how :-) — This is on Windows, BTW.
Everything starts with the hs_err_pid*.log file that JVM...
on Feb 19, 2009
The release is available here. The Release Notes reveal that, at last, it "supports the New Java Plugin and Java Webstart on AMD64 architecture, on Windows platforms" - fixing the Bug Database's second-most voted bug, except that just on Windows right now, hopefully Linux will follow in 6u14+ (since 6u13 should be a security release). It's also not a completely delivery of all 6u10+...
on Feb 3, 2009
Java FX vs. Swing
Part of the attacks to Java FX comes from Swing developers who see JFX as something that's just diverting effort from Sun; and in the long run, could imply Swing's obsolescence. Certainly not a deprecation, but a slow death if no major improvements happen as Sun and the larger ecosystem moves to support JFX exclusively. Personally, I don't think the JFX/Swing competition is a...
on Jan 7, 2009
After spending way too much time on ways to speed up web applications, you'll find that your greatest mileage comes in database optimizations, networking, and reducing the bytes downloaded (an example). Time spent optimizing Java code is seemingly insignificant between waiting on the request, waiting on the database, waiting on the services, and waiting on the response.
There's a catch, of...
on Dec 23, 2008
A PropertyEditor interface provides support for GUIs to enable editing a property value of a given type. The interface supports a variety of ways to display and update property values. One of these ways is to employ the string representation of a Java code fragment that can be obtained by getJavaInitializationString, the method all standard property editors implement. To test this feature, one...
on Dec 17, 2008
I'm the tech lead of the new JWebPane project, a browser plugin for Swing and soon
FX. We showed a preview this past JavaOne that was well received, and I wanted to
give everyone an update on where we are.
JWebPane is a WebKit based browser component for Java, and will be posted as open
source on java.net in the near future. I'...
on Dec 10, 2008
Pivot 1.0.1 contains a couple features we wanted to get in for version 1.0 but didn't have time, as well as a number of minor bug fixes. Specifically, component skins are now all drawn using gradients, producing a much more modern UI appearance, and an Accordion component has been added. This version supersedes the previous 1.0.0 release.
Pivot 1.0 buttons:
Pivot 1.0.1 buttons:
on Oct 23, 2008
The Pivot development team is happy to announce the release of Pivot 1.0. Pivot is an open-source framework for building high-quality, cross-platform applications that are deployable both via the web and to the desktop. It began as an R&D effort at VMware but has now been made available to the community as an option for developers who want to build rich internet (RIA) applications in Java....
on Oct 15, 2008
I had an interesting thought the other day for a project I'm helping a friend with. Many things we deal with come in key/value pairs (URL parameters for instance). Why not immediately work with objects instead? There's a simple way...
Probably someone is already doing this - there are certainly enough serialization libraries out there. But here's the thought - I was thinking of URL...
on Aug 16, 2008
Here is a simple pattern which you can use to make your
APIs extensible, even by third parties, without sacrificing
your ability to keep backward compatibility.
It is very frequent to create a library which has two
“sides” — an API side and an
SPI side. The API is what applications call
to use the library. The SPI (Service...
on Aug 11, 2008
Where's the state? This is a small but useful question when
deciding how a problem domain gets carved up into objects:
What things have state? What things have values that
can change? When and how can they change? Can the changes be
observed? Who needs to observe changes in state?
These questions make a good start...
on Aug 7, 2008
One thing which I think about often is the design of code,
and APIs. I've been working on
deriving some principles from the things I do intuitively based on
experience. Whether those are useful to anyone else is an open question.
Peer review is the best tool for figuring
out if these...
on Aug 5, 2008
Very soon, in a week or two, the Java compiler (javac), packaging tool (jam), and the Java module system implementation in the OpenJDK Modules project will support the new module keyword (the language support for JSR 277).
The engineering team have built a special workaround to enable ourselves to build the Java module system while waiting for the language support. With the javac and jam tool...
on Jul 25, 2008
I needed to load the classes from the dt.jar archive on the fly. The path to the archive was generated automatically based on the "java.home" system property. The original idea was to use the <a href="https://java.sun.com/javase/6/docs/api/java/net/URLClassLoader.html">URLClassLoader</a>, but it could not find classes. I had to write a custom class loader which read an...
on Jul 25, 2008
The draft specification for supporting OSGi bundles in the Java Module System is currently under discussion in the JSR 277 Expert Group.
To enable the EG and the community to provide feedback, we have included an OSGi repository prototype in the OpenJDK Modules project. The prototype currently supports only Apache Felix OSGi implementation for proof-of-concept. There are open issues to be...
on Jul 24, 2008
On May 23, I gave a presentation at Sun about computer science students,
and how a company can engage with them (audio | slides). Here
are some of the questions that I was asked, and the answers that I gave (or
wish I had given), and a question that I wish I had been asked.
What can we do to get more students to use OpenSolaris?
(Asked by two people in
marketing who were eager to give me...
on Jun 7, 2008
Day 4 of Java One is over. Even without huge announcements or great
surprises, it was a great conference. Here are my impressions from the cool
stuff keynote and my takeaway what it all means.
The Cool Stuff Keynote
My mind wanders during most keynotes, but I always enjoy James Gosling's
cool stuff keynote on the last day of Java One. No marketing, just one
amazing Java-powered piece of hardware...
on May 9, 2008
My day 3 at Java One ranged from the Nimbus UI and the future of JSF to
interesting discussions about closures and Scala. Details below.
The presentation on the Nimbus look and feel
was packed. Nimbus is a pretty L&F, and it will be the standard for Java
FX. Everything is vector-drawn, so it will scale nicely to high-resolution
displays. (Check out this nifty sampler.) I would like to...
on May 8, 2008