Java

Groovy 1.6 Released

Tagged:  

The final version of Groovy 1.6 is now available for download. For those who don't know, Groovy is a scripting language hosted on the JVM with many of the features that Java programmers may find themselves missing--optional/dynamic typing and closures to name two--but with a syntax that is still very familiar for Java programmers. It is a natural complement to Java for tasks like GUI or web application development.

Beyond the many bug fixes and improvements in 1.6, the major focus of the release was performance, which had been somewhat of an Achilles heel for the language in the past--especially when compared to the more aggressively optimized JRuby. Groovy 1.6 sports a performance improvement of somwhere between ~150% and 460% (and yes, all the usual caveats about micro-benchmarking do apply), a solid boost that should mollify some of the performance objections to using the language.

Other useful features of the release include:

  • The ability to create annotations in Groovy (previously had to be done in Java)
  • Multiple assignments, e.g. def (a, b) = [1,2]
  • Abstract Syntax Tree (AST) tranformations, which give the developer the ability to hook into the compilation process before code is turned into bytecode--examples include @Singleton for making a class into a singleton, @Immutable for making instances immutable
  • Improved support for OSGi

JavaFX 1.1 Released with Mobile

Tagged:  

Sun has released version 1.1 of the JavaFX platform, which now includes JavaFX Mobile (previous releases were JavaFX Script only). Partners listed for JavaFX include Sony Ericson, LG Electronics, Orange, Sprint, Cynergy and MobiTV.

The SDK and other tools (including the dedicated version of Netbeans 6.5 with the JavaFX plugin) are available from the JavaFX site.

The official Sun press release is here.

Java 6 Update 12

Tagged:  

Sun has released the newest version of the Java runtime, Java 6 u12. Earlier versions of the language, Java 5 and 1.4.2, have also been revved to 1.5.0_17 and 1.4.2_19 respectively. Most notable in this release is 64-bit support as well as support for Windows 2008. There are also a number of bug fixes and performance enhancements (especially to JavaFX) as described in the release notes here.

You can download the new JRE or JDK here.

Referencing Subtypes in Generics

Tagged:  

I ran into a problem recently while programming in Java where I wanted to define an interface method that returned a generic type which was tied to the type of the implementing class. If that sounds a little long-winded, let me give an example...

Let's say we have a Thing interface that defines a method for getting a type token, public Class<T> getType(). The Thing interface has several implementers, MyThing, YourThing, HisThing, HerThing, and so on. How does one make sure that T is the right subtype in the interface, which has no "knowledge" of its implementers (the same could be said of any base class and subclass as well)? Actually, the answer was sitting right under my nose in the core java libraries themselves, in the Enum class, whose declaration looks like this:

public abstract class Enum<E extends Enum<E>>

The E generic type looks a little confusing at first, like a kind of recursive definition. But when you think about it, it makes perfect sense: E is a subclass of an Enum type that is generified with the type--what else?--E. And E must be the appropriate subtype in any implementing class. So getting back to our little example, I could now retrofit my Thing interface to look like:

public interface Thing<T extends Thing<T>> {
     public Class<T> getType();
}

Any implementer now simply references itself in the generic type declaration:

public class MyThing implements Thing<MyThing> {
     public Class<MyThing> getType() { ... }
}

Most programmers prefer to think of generics only in the context of collections. But this provides a good example of how generics can establish type relationships in ways that are not possible in more traditional OOP methodology.

Apache Ivy 2.0 Released

Tagged:  

The Apache Ivy project, now a subproject of Ant but formerly a product of Jayasoft, has released version 2.0 of its dependency management solution for Ant build files. It is the first stable release of Ivy since becoming a full-fledged subproject of Ant.

The release features increased compatibility with Maven 2.0, improved cache management, a new "packager" resolver, and better handling of relative paths. Ivy has become an excellent tool for those unable (or unwilling) to move to Maven, but unable to live without dependency management (though there is also Maven's own Ant tasks).

Ivy 2.0 is available for download here. The IvyDE Eclipse plug-in (essentially an editor for ivy.xml files and a classpath container for your dependencies) is also available through the update site:

http://www.apache.org/dist/ant/ivyde/updatesite

Tapestry 5 Released

Tagged:  

The 5.0.18 version of Apache Tapestry has been christened as the first release of Tapestry 5. The release is the capstone of long effort to re-write the web application framework from scratch, removing a lot of the complexity of previous releases toward a more POJO and annotations-driven approach (and making it non-backward compatible with version 4, a sore point for some current Tapestry users).

For those who don't know, Tapestry is a component-based web application framework (one of the original) for Java similar to JSF or Wicket.

New features:

  • POJO component classes: no interfaces or base classes required
  • Minimalized configuration via annotations and naming conventions
  • Live class reloading (think JavaRebel)
  • Its own dependency injection framework (Tapestry IoC)
  • Built-in AJAX support via Prototype/Scriptaculous
  • Tapestry template pages are now valid XHTML (with a custom namespace for Tapestry), making them easier to work with, especially when round-tripping between designers and programmers (an approach similar to Wicket's)
  • Automatic REST-style URLs
  • Automatic client-side form input validation
  • Built-in components such as BeanEditForm, BeanDisplay, and Grid
  • Really nice exception handling

You can download the release here, or (for Maven-style dependency management junkies like myself) reference the dependency: org.apache.tapestry:tapestry-core:5.0.18.

Eclipse Plug-In for JavaFX

Tagged:  

Sun has released an early version of an Eclipse plug-in for JavaFX. It's still a bit buggy, but it's an opportunity for developers to kick the tires. The functionality is roughly equivalent to that of the Netbeans plugin.

Instructions on how to use the plug-in are here. You should use the download page here, though, to get the actual plug-in itself.

RedHat releases JBoss AS 5.0

Tagged:  

JBoss has released version 5.0 of its popular Java application server, completing a 3 year odyssey to redesign its microkernel architecture (the JBoss Microcontainer). JBoss AS 5 is designed around the concept of a "Virtual Deployment Framework", an AOP-based design that analyzes deployments and produces metadata to be consumed by the container itself, which in turn instantiates and wires together the various pieces of a deployment, controlling their lifecycle and dependencies. The server also integrates other projects from the JBoss umbrella, including JBoss Cache and JBoss WS.

JBoss AS 5.0 is a fully JEE 5.0 compliant application server. It can be run on both Java 5 and 6. After this release, the JBoss team now moves on to JEE 6.0.

It can be downloaded here.

JavaFX 1.0 Released

Tagged:  

Sun has just released the JavaFX platform, consisting of 3 major pieces: the JavaFX SDK, the Netbeans 6.5 IDE with JavaFX, and the JavaFX Production Suite (formerly Project Nile), a set of tools to allow designers the ability to import digital assets from design tools such as Photoshop and Illustrator.

All are available for download on the JavaFX site, which was redesigned (thankfully) for the launch.

As noted in the Sun blogs, JavaFX Mobile is currently in beta and expected to be released in February.

Java 6 Update 11

Tagged:  

Sun has released Java 6 Update 11, which contains the JavaFX runtime. The official release of the JavaFX SDK will be tomorrow (12/4/2008). The JRE itself is also available from Sun's auto-update site.

Syndicate content