Tuesday, November 03, 2009

New features in Java 6.0 (Mustang)

In this Java release SUN has not done much changes at language level rather major enhancement is done in core, XML and desktop sections.

Any feature or enhancement in Java is encapsulated in the form of a JSR (Java Specification Request) which details the need for a specific functionality to be available in the Java Platform that can be used by Applications. These JSR's will be reviewed and released by Java Expert Groups (JEG).

Following the major list of features (JSRs') that comes with the Java 6.0.

Java Compiler API (JSR 199)
JDBC 4.0 (JSR 221)
Scripting in the Java Platform (JSR 223)
Pluggable Annotation Processing API (JSR 269)
Common Annotations (JSR 250)
Java API for XML Based Web Services - 2.0 (JSR 224)
JAXB 2.0 (JSR 222)
Web Services Metadata (JSR 181)
Streaming API for XML (JSR 173)
XML Digital Signature (JSR 105)
Java Class File Specification Update (JSR 202)

I will try to explore and explain each of these JSR's in my future articles.
The latest java 6.0 can be downloaded from here. I am really excited about scripting framework, scripting API and new JDBC 4.0 API in this release.


List of top 10 features in Java SE 6.0 adapted from SUN's site

Web Services
You get first-class support for writing XML web service client applications (death of Apache Axis?). No more messing with the plumbing (unless you really want to). You can also expose your APIs as .NET interoperable web services with a simple annotation.
For developers who want to handle XML directly Mustang adds new parsing and XML to Java object-mapping APIs, previously only available in Java EE platform implementations or the Java Web Services Pack.

Scripting
You can now mix in JavaScript technology with your Java technology source code, useful for prototyping. Also useful when you have teams with a variety of skill sets.

Database
The final Mustang development kit will co-bundle the all-Java JDBC database, Java DB based on Apache Derby. This should enable developers (new to Java) to get a jumpstart on java development.
Developers will get the updated JDBC 4.0, which focuses on ease of use. It contains many feature additions like support for XML as an SQL datatype and better integration of Binary Large OBjects (BLOBs) and Character Large OBjects (CLOBs) into the APIs. Additional features that improve ease of use include removal of some JDBC boilerplate and some of the new annotations that make SQL strings embed better into your JDBC application - like decorating your getAllUsers() method with an @Query(sql="select * from user") annotation, and that being all you need. More annotation love for you.

More Desktop APIs
GUI developers get a large number of new tricks to play like the ever popular yet newly incorporated SwingWorker utility to help you with threading in GUI apps, JTable sorting and filtering, and a new facility for quick splash screens to quiet impatient users.

Monitoring and Management
The really big deal here is that you don't need do anything special to the startup to be able to attach on demand with any of the monitoring and management tools in the Java SE platform. Mustang adds yet more diagnostic information, and we co-bundled the infamous memory-heap analysis tool Jhat for forensic explorations of those core dumps.

Compiler Access
Really aimed at people who create tools for Java development and for frameworks like JavaServer Pages (JSP) or Personal Home Page construction kit (PHP) engines that need to generate a bunch of classes on demand, the compiler API opens up programmatic access to javac for in-process compilation of dynamically generated Java code. Finally you don't have to save your code as a Java files and invoke javac to generate a classfile, a clumsy procedure at best.

Pluggable Annotations
Java tool and framework vendors (and you) can define annotations and have core API support for plugging in and executing the processors that do the heavy lifting. It seamlessly integrates your custom annotations .

Desktop Deployment
Better platform look-and-feel in Swing technology, LCD text rendering (more clarity on LCD monitors like Vista), and snappier GUI performance overall. Java applications can integrate better with the native platform with things like new access to the platform's System Tray and Start menu. At long last, Mustang unifies the Java Plug-in technology and Java WebStart engines, which just makes sense. Installation of the Java WebStart application got a much needed makeover.

Security
Mustang simplified the job of security administrators by providing various new ways to access platform-native security services, such as native Public Key Infrastructure (PKI) and cryptographic services on Microsoft Windows for secure authentication and communication, Java Generic Security Services (Java GSS) and Kerberos services for authentication, and access to LDAP servers for authenticating users.

Quality, Compatibility, Stability
Sun has around 80,000 test cases and several million lines of code testing conformance. People have been downloading (and testing) snapshots of Mustang for the last 15 months and filing bugs. So even before beta several quality and regression issues were fixed. Performance is claimed to be better than J2SE 5.

Popular Posts