Skip to main content

Rocket

Posted by editor on July 26, 2007 at 6:53 AM PDT


Some off-topic tools to speed up your webapp and clean up your code

A couple of interesting tools have been mentioned on some of our internal lists recently... they didn't really suit the Java Today section as front-page items, but they might be of use to many Java developers.

The first, mentioned by Mike [bondolo] Duigou on the Community Leaders list, is YSlow, a performance tool that analyzes web sites from a performance point of view. As described by its announcement, "YSlow measures web page performance based on the best practices evangelized by Yahoo!'s Exceptional Performance team. Since many of these best practices focus on the frontend, YSlow is integrated with Joe Hewitt's Firebug, the web development tool of choice for frontend developers."

Meanwhile, Google has released a Java static analysis tool called the Google Singleton Detector, which detects several types of global state: not just singletons, but some variants which Google engineers have given funny names to: mingletons, hingletons, and fingletons. And once you find them, you're supposed to eliminate them.

Say what? Everyone uses singletons, right? Well... not so much anymore, according to Google's Why Singletons Are Controversial:

The use of singletons is actually a fairly controversial subject in the Java community; what was once an often-used design pattern is now being looked at as a less than desirable coding practice. The problem with singletons is that they introduce global state into a program, allowing anyone to access them at anytime (ignoring scope). Even worse, singletons are one of the most overused design patterns today, meaning that many people introduce this possibly detrimental global state in instances where it isn't even necessary.

The document goes on to claim that this introduction of global state complicates testing (which in turn thrwarts agile development), and hides dependencies.

So while the Yahoo tool is focused on performance (and limited to webapps), the Google tool prescribes better programming practices to encourage testability and maintainability. They're two very different approaches to improving your code.


In Java Today,

JSR review balloting is underway for JSR-317 (Java Persistence API 2.0) and JSR-318 (Enterprise JavaBeans 3.1). JPA 2.0 intends to add additional object/relational mapping functionality and query language capabilities, a criteria-based query API, and to standardize features that are currently optional. Meanwhile, EJB 3.1 aims to simplify the EJB architecture, with a focus on the core session bean and message-driven bean component models and their client API. Balloting for both JSR's ends on Monday, July 30.

The cq3G project is a suite of 48 tests based on 24 Test Cases for GSMNA Test Specifications for JAVA Micro Edition, Revision 1.0.3 February 20, 2007. The tests in the cq3G test suite are based on the Java Requirements of the Global System for Mobile Communications North America (GSMNA) - 3G Americas (3GA). This set of requirements delivers a defined and verifiable platform for the wireless community in the Americas.

The JDJ article Effective Development of Java Conformance Tests Meta-programming presents a case study of the use of meta-programming in Java compatibility testing. It shows how parts of the source code can be shared between different products and modified to generate programs targeting specific functions and describes the approach Sun Microsystems has used for building Technology Compatibility Kits (TCK) for more than five years.


Today's Weblogs kicks off with showing how to make a Java Dock (Launch Bar).
"With the timing framework and the glass panel, you can create almost any UI component. Offering cool and complex behaviors. In this blog I present a version of a launch bar (Dock)."

What's behind
Nigel's Law? Nigel Daley explains that "the fringe, the boundary, the infrequent, the unlikely -- all occur quickly and often when operating software on large clusters with thousands of nodes, therefore..."

Finally, in
Vacation: Backwards Compatibility Story, Ed Burns shares a small story about the extent and possibilities of backwards compatibility.


In today's Forums,
bamboat_3 is trying to put together a
Dynamic JProgressBar.
"I have created Applet-Servlet Communication Application, where I am trying to save the data via servlet and in return it sending boolean value to the applet. So, I would like to implement a JProgressBar, which may display at the time of data saving and the value of JProgressBar increase as the boolean value returns from servlet. Here I need your help, that if any one have an example (either in Applet or Swing Application) of JProgressBar, which may increase bar value upto 10% via Thread notify() method on the boolean value returns in true and after increasing upto 10% get the Thread wait() for the next boolean value returns in true."

Ken Warner asks
Why am I getting a null pointer exception when I try to get the drawGraphics from a BufferStrategy?
"Every once in a while, if I stop or restart the applet at just the wrong time I see the following exception [...] I check to see if the BufferStrategy is null before trying to get a new drawGraphics. It never says it's null. It's annoying. I didn't begin to get these errors until I recoded to use the canonical render loop for BufferStrategy."

jslott discusses Project Wonderland packaging in
Re: Incubator build script and folder structure.
"Terrific! I really like the module mechanism -- it is exactly what will make Wonderland all the more better than it already is. In terms of all that is needed for the module files -- I suspect a JAR might do (see discussion on XML files below). [...] I had a lengthy discussion with Paul today about describing the world by a series of XML files that would fit in with your post here. We talked about having the world be reflected on disk by a directory structure and each cell being describing by XML. The class name would be already embedded in the XML, so as long as the GLO class is found in the classpath, the XMLDecode routine should be able to instantiate it. (hence may make incorporating new cell types relatively simple I think)."


Current and upcoming Java
Events
:

Registered users can submit event listings for the href="http://www.java.net/events">java.net Events Page using our href="http://today.java.net/cs/user/create/e">events submission form.
All submissions go through an editorial review before being posted to the
site.


Archives and Subscriptions: This blog is delivered weekdays as
the Java
Today RSS feed
. Also, once this page is no longer featured as the
front page of java.net it will be
archived along with other past issues in the href="http://today.java.net/today/archive/">java.net Archive.

Some off-topic tools to speed up your webapp and clean up your code