Book Review: Java 6 Platform Revealed

   

Books Index

by John Zukowski
Publisher: APress, Inc.
Publication Date: July 2006
ISBN: 1-59059-660-9

Reviewed by Robert Eckstein
November 2006

 

As Sun gets ready to release version 6 of the Java Platform, Standard Edition (Java SE 6), I was grateful to receive a copy of the first book about the new version, written by John Zukowski and published by APress, Java 6 Platform Revealed. If you've been watching what publishers of computer books have released in the last few years, you've probably noticed that APress has been publishing a number of solid technical books recently, and Zukowski's Java 6 Platform Revealed is no exception. At 220 pages, it's a great introduction to the new features of the Java SE 6 platform, packaged in a small, readable text that takes very little time to read.

About the Book

After a quick overview of some of the new features in the Java SE 6 platform, Chapter 2 presents some of the language and utility updates. For example, here's an interesting addition: Did you know about the new java.io.Console class? You can get a hold of this using the System.console() method. The canonical example on page 16 shows us one of several differences between using the old System.out method and the new java.io.Console :

System.out.println("Espanol");
System.console().printf("%s%n", "Espanol");

With the method on the first line, println() is used with an PrintStream object, which will throw away the high-order bit of each of the String's characters. That's disastrous if you plan to use internationalized characters, such as the ñ in Spanish, because it will instead display a plus-or-minus character (±). However, System.console().printf() will preserve the proper character data, displaying international characters correctly.

Also, here's some functionality that I'll be using quite a bit: the new Deque interface. That's a double-ended queue, pronounced "deck" instead of the "de-queue" you might expect, which allows you to add and remove items from either end of a queue collection. As expected, you can traverse the queue from either direction, front to back or back to front. The java.util.LinkedList utility class is one that you are most likely to use that implements the Deque interface.

Chapter 4 lists plenty of additions to the platform in the Abstract Window Toolkit (AWT) and Java Foundation Classes/Swing (JFC/Swing) arena. Articles published on Java Sun have discussed most of these topics, but Zukowski's book reviews them in great detail. These additions include the following:

  • Splash screens
  • System tray
  • New dialog modality model
  • Text antialiasing
  • Table sorting and filtering
  • Inclusion of SwingWorker in the JFC/Swing libraries

The last item is one of my favorite additions. Since the 1998 publication of the SwingWorker class in the article " Threads and Swing," developers have repeatedly requested that Sun move it into the Core Java technologies. At the 2004 JavaOne conference, the Java Desktop team presented a new version of SwingWorker that included generification, use of the concurrency package, and PropertyChangeListener support. Much of this functionality assists with interthread communication. The Java SE 6 platform incorporates a similar version of SwingWorker that greatly assists developers in processing GUI-driven functionality off the event-dispatching thread, indicating status and progress, and aggregating the results.

If you work with Java Platform, Enterprise Edition (Java EE), then you definitely want to keep Chapter 5 handy. This chapter covers Java Database Connectivity (JDBC) 4.0 in exquisite detail. Writers have also discussed this topic in articles on Java Sun, but following is a list of the most common changes in the java.sql and javax.sql packages:

  • Database driver loading
  • Exception-handling improvements
  • Enhanced Binary Large Object (BLOB)/Character Large Object (CLOB) functionality
  • Connection and statement interface enhancements
  • Locale-specific character set support
  • SQL ROWID access
  • SQL 2003 XML data type support
  • Annotations

Even if you use an intermediary technology, such as Java Data Objects (JDO), you should really read Chapter 5 to get a feel for the underlying changes in JDBC 4.0. This is information that no developer programming for enterprise Java technology should be without.

Chapter 6 introduces some of the new XML libraries, including the Java Architecture for XML Binding (JAXB) libraries now located at javax.xml.bind , the XML digital signature libraries at javax.xml.crypto , and the libraries for the Streaming API for XML (StAX) at javax.xml.stream and javax.xml.transform.stax , among others. Zukowski discusses a myriad of changes in this chapter, so read it carefully and augment it with the official documentation if you plan to parse and output XML in your Java platform application.

Chapter 7 introduces the new features of web services in the Java SE 6 platform. Probably the most important is that you can now use annotations in front of your classes and methods to indicate that they are intended for web services. Here's an example:

@WebService
public class HelloService {

   @WebMethod
   public String helloWorld() {
     return "Hello, World";
   }
}

One caution: Zukowski's book does not mention that the Java SE 6 platform can now act as a web-service server, as this article shows in more detail. This is likely because the feature was not yet available when his book went to press.

Finally, did you know that you can now run JavaScript technology inside the Java SE 6 platform? Zukowski discusses this in Chapter 9, which goes over the classes in the javax.script package. This package contains only a few classes and interfaces, but it won't take you long to figure out how to invoke the embedded Rhino JavaScript interpreter using the ScriptEngine.eval() method, as well as binding your own Java objects to objects inside the JavaScript technology interpreter.

Summary

Java 6 Platform Revealed is a good succinct introduction to the Java SE 6 platform. In fact, about the only negative that I can see about this book is one that the publisher clearly knows: Apress published it well before the soon-to-come final release of Java SE 6, so many of the features are still working their way through the beta process and may change if the JSR 270 Expert Group so desires. However, given the choice between not knowing any of the new features and knowing about features that exist in beta but may change, I'll definitely take the latter.

Table of contents

Curious about this book? Take a look at the table of contents at the publisher's web site.

Ordering Information

APress
Amazon.com
Bookpool.com

By the Way

If you are a Java technology publisher and would like me to review your Java SE, Java ME, or Java EE book on Java Sun, don't hesitate: Send me an email right now. No, I mean it. Stop what you're doing and write me. Have you contacted me yet? OK, good. And now for my standard disclaimer: I won't review every book I receive, but we all know that there are some gems out there that really deserve the limelight. So let me know what they are.

Rate and Review
Tell us what you think of the content of this page.
Excellent   Good   Fair   Poor  
Comments:
If you would like a reply to your comment, please submit your email address:
Note: We may not respond to all submitted comments.
Left Curve
Java SDKs and Tools
Right Curve
Left Curve
Java Resources
Right Curve
JavaOne Banner Java 8 banner (182)