News on Monday
more>>
SharePoint Tech Report
more>>


   

 
 
Download Current Issue
ISSUE 2/1/2010 PDF

Need Back Issues?
DOWNLOAD HERE

Receive the print Edition?


 
blogs tab
Visual Studio 2010 Release Candidate Available Today
A Visual Studio 2010 release candidate is available on MSDN.
02/09/2010 09:45 AM EST

Is Microsoft eyeing Office subscription pricing?
Microsoft may be preparing to offer a new Office pricing option called "union," which charges the same for cloud as on-premises.
02/01/2010 09:38 AM EST

Facebook rewrites PHP runtime
Facebook is about to open source its own PHP runtime, written from scratch for speed.
01/30/2010 08:53 PM EST

 

Events calendar tab
2/9/2010 to 2/13/2010
San Francisco
IDG World Expo

2/10/2010 to 2/12/2010
San Francisco
BZ Media

2/17/2010 to 2/25/2010
Atlanta
Python Software Foundation

2/19/2010 to 2/20/2010
Los Angeles
SCALE

2/21/2010 to 2/24/2010
Las Vegas
IBM


 
Most Read Latest News Blog Resources

That’s One Gallopin’ Mustang, Sun!




October 1, 2006 — 
Unlike some of my more austere colleagues, I find what Sun is doing with the new releases of Java to be mostly good, and certainly exciting. Personally, I have felt this way since the Java 5 release. In my coding work these days, I use nearly all the features that release gave us. Generics, enums, annotations, varargs, printf(), the new for-loop—pretty much everything. I like the syntactic sugar and the convenience they bring, so I use them wherever I can.

We can all debate about whether these additions were too little, too late. However, as I have pointed out before, I really don’t think it’s too late for Java in the way Bruce Tate (of “Beyond Java” fame) and the legions of Ruby enthusiasts do. The changes might be too little, but Sun has a bunch of new stuff in store for Java 6, code-named Mustang, that’s got me wondering whether I should switch over even before its final release (currently set for October). Mustang also has one peculiar addition, which I’ll discuss shortly.

An improvement that will be of interest to many readers is the incorporation of a bunch of XML and Web services technology from Java EE, combined with some annotation magic. You now can define a function and, with the single @WebService annotation, convert it into a Web service. (And if you want to test it on the spot without uploading your classes to the corporate Web server, you can use the built-in, barebones HTTP server.) It’s pretty much that simple: An annotation and a pair of import statements are also needed.

Another feature, which will gladden the hearts of the scripting enthusiasts budding within us all, is the addition of a new bytecode, invokedynamic, that makes scripting engines embedded into Java much more efficient. The bytecode facilitates the execution of methods in the absence of type information. (Essentially, it permits the code to do non-Java things. While this addition is being done strictly to support embedding languages that use duck typing, one has to wonder whether this is not laying the groundwork for more scriptinglike Java syntax in the future.)

The geeky part of me is particularly fascinated by another capability, which enables me to compile code on the fly and hot-load the class while the application is running. This is cool stuff and has some practical uses. For example, suppose you have hard-coded business rules, and based on data you’re processing, you recognize that an entirely different rule set is necessary. In such a case, it might be easier and faster to regenerate the code for the business logic, compile it and load it than it would be to write hugely complex decision tables that incorporate all the various possibilities.

Mustang also adds some convenience features. The most important, to my eye, is way overdue. It enables wildcards to be used when specifying the classpath. Now, you can put your jar files in a single directory, and specify that directory followed by an asterisk as your classpath, and the JVM will properly locate all the libraries it needs. Unfortunately, wildcards are only a feature of Java 6, not part of the specification, so implementations are free to not include support for them. At the syntactical level, there are small dabs of sweetness, one of which is the long overdue isEmpty() test for a string.

Mustang also adds and gets rid of baggage. The latter, which I believe is close to a first, was reported by Alex Handy in the Aug. 31 issue of SD Times’ News on Thursday newsletter. In it, he discusses Sun’s intention to drop little-used features, such as JDK support for MIDI files—a large blob of code that, apparently, was rarely used.

The JDK does add a peculiar item: a relational database. Sun decided that some kind of reference database for small desktop applications was in order—something akin to Microsoft’s free Desktop Edition of SQL Server. So, it is bundling the Apache Derby database in the JDK. This DBMS is a polished product that was formerly IBM’s Cloudscape (and previously, it was a product of Informix, which acquired it from its original designers). I have no problem with the product choice, but I think a database is a peculiar thing to include in a JDK (and not in the JRE), especially when there is no shortage of free, well-tested Java databases from which to choose.

Putting the database question aside, Java 6 is clearly continuing Java SE 5’s march toward making Java friendlier and more usable. Java 7, which I will surely discuss in a future column, is pushing further along this path. I wish only that these new releases occurred more frequently than once every two years.

Andrew Binstock is the principal analyst at Pacific Data Works.


Share this link: http://www.sdtimes.com/link/29602
 

Add comment


Name*
Email*  
Country     


  • Comment
  • Preview
Loading