Wednesday, November 29, 2006

Semplice Is Dead. Long Live Semplice!

WARNING: This blog entry was imported from my old blog on blogs.sun.com (which used different blogging software), so formatting and links may not be correct.


My co-conspirators on Project Semplice, John Kline and
Herbert Czymontek, have both recently left Sun. Rest assured, I'm not going anywhere. But where does that leave Project Semplice?



Well, the spirit of the project was to support scripting on the VM. We started our research with BASIC, but the vision all along was to design things in such a way that we could support multiple scripting languages, without starting from scratch each time. The tooling aspect was my responsibility, and I'm happy to say it has not been in vain. With the hiring of the JRuby developers, I've been focusing on how to adapt everything to support Ruby, and it's going really well.

I'll post a second blog entry on that shortly.



Back to BASIC. Like most software at Sun, open source is the obvious strategy and we have started the process. On the other hand, just "dumping code on the community" is not likely to be successful, so we're looking for interest and support to decide how to proceed.



In any case, as the blog title suggests, the project is not dead. It was a research project, we've learned a lot, and the technology is now forming the basis for some great new scripting tools coming your way very soon. Rising out of the ashes, so to speak! We'll have more to show at JavaPolis in a few weeks, so keep your eyes peeled!


NetBeans + Ruby = True

WARNING: This blog entry was imported from my old blog on blogs.sun.com (which used different blogging software), so formatting and links may not be correct.







Click on image for full size. Some things to notice: semantic highlighting (for example, parameters are shown in different colors than local variables), code completion, mark occurrences (other uses of the length method under the caret is highlighted), ...



You'll see more at JavaPolis... and on this blog!


Sunday, November 12, 2006

Java Open Sourced - Podcast Special

WARNING: This blog entry was imported from my old blog on blogs.sun.com (which used different blogging software), so formatting and links may not be correct.


It seems I'm late to join the blogging party; just about everybody has covered the news already. In the unlikely
case that you haven't read about GPL'ed Java, read just about any blog on blogs.sun.com (and many on java.net). The main resource page is http://www.sun.com/software/opensource/java/.



We've got a special episode dedicated
to this on the Java Posse. It's an hour interview with
Mark Reinhold,
Rich Sands and
Eric Chu
discussing just about everything related to this. Please check it out
(and digg it).


Thursday, November 2, 2006

Using JDK 5 language features in Creator

WARNING: This blog entry was imported from my old blog on blogs.sun.com (which used different blogging software), so formatting and links may not be correct.


As you're probably well aware of, there were several important releases this week. First, NetBeans 5.5 was
released. This has been covered extensively by other Sun bloggers
so I won't repeat the highlights here - just check it out if you haven't already.



Second, a number of add-on packs for NetBeans 5.5 were released. A pack is a cluster of plugins.
One of these is the

Visual Web Pack
, which basically bundles all the visual web page design functionality from Creator into NetBeans. With this, you can create pages Creator style alongside other NetBeans features, such as the profiler, or the UML tool, or the enterprise XML support.



There's another big reason why even Creator users should try the visual web pack (which is in technology preview state, not a final release like NetBeans 5.5.). It offers new support for Java 5 language features, as well as Java EE 5 support. I took it for a quick testspin and thought I would show it in action here.



If you download NetBeans 5.5, and then the Visual Web Pack installer, you can create Visual Web Projects. Unfortunately, out of the box, it will only offer to create J2EE 3 and J2EE 4 projects. The reason for this is that NetBeans is only bundled with the Tomcat web container, and Tomcat is not adequate for Java EE 5 projects. Thus, the trick is to also download a Java EE 5 capable app server such as Glassfish or its cousin, the Sun Application Server. Once you've done that, and you select it as the target in the new project dialog, you are able to create a Java EE 5 project. Hopefully we'll have everything ready as a single bundle so that out of the box, you're defaulting to Java EE 5 projects and Java 5 source. Here's the configuration portion of the New Project wizard (click Manage to register additional web servers).






Let's create a simple web app which utilizes Java 5 features. It will be a simple page which lets you provide the name of a Java class, and then the methods (possibly generic) of the class are displayed. Here's what the web app looks like in the designer:






Here's the button click event handler:






Note that we simply use the error method to log messages for the page; these are all displayed in the group message component. This is a very simple way to log messages for ourself during debugging. You should always have a Message Group component, on every single page of your application, during development. This will make it immediately obvious if you have validation errors or other problems that might otherwise silently occur and leave you scratching your head.



When we run and try it with some sample data, here's the result which shows Java 5 language features in action:






The next step is to play with Java EE 5 features mixed with JSF. That will have to wait for another day; I've gotta get back to my day job, which I'll blog about soon.