More from the JavaOne 2006 keynotes…
At JavaOne on Tuesday, Sun took the wraps off of two new projects that are taking advantage of this capability in a way that will be of interest to web developers. The first, Project Semplice, brings the Visual Basic language to the Java platform. Not meant for porting existing VB apps over to Java, but rather for allowing Visual Basic developers to transition to the Java platform while leveraging their existing skills, Semplice lets you write code using VB syntax (including all the automatic type conversion, support for properties implemented by methods, and other niceties that VB developers love so much) that compiles to Java classes that will run on the Java 6 VM. As J# is to Java, Semplice is to Visual Basic.
In the demo during the keynote, Semplice developer Tor Norbye (regular on the Java Posse podcast) demonstrated building a simple web application in VB using a pre-release version Java Studio Creator. Starting from a blank page, he dragged a number of JavaServer Faces (JSF) components onto the page, then double-clicked one to add an event handler to it. The editor that popped open contained a new event handler written in Visual Basic, to which he quickly added some simple implementation code, then compiled and ran the application.
The application, he pointed out, made use of JSF components written in Java, and he accessed properties of these directly from his Visual Basic code. Additionally, the JSF components call the Visual Basic event handling code from within Java. Semplice allows these two languages to work together transparently.
Thanks to features of the VB language, instead of having to call
farenheit.getText() to obtain the value of the
farenheit form field, he could refer to it as
farenheit.Text, or even just as
farenheit, thanks to Visual Basic’s flexibility. He was also able to use the resulting
String value in an arithmetic calculation (i.e.
celsius = (farenheit - 32) * 5 / 9) without having to convert it to an integer.
For developers that want the power of Java when writing server-side business logic, but want a more flexible and loosely-typed language when writing web presentation logic, Visual Basic running on the Java VM could well be a very attractive option!
Along with the many other projects working to bring other languages to the Java VM, these two projects give developers even more choices when considering Java as a web development platform.
The video of both demos may be found in Segment Three of the Sun Technical General Session: Java Platform Roadmaps: The Big Stuff, Today & Tomorrow from Day 1 of the JavaOne 2006 conference.