May 17 2006

Groovy On The JVM

I attended the Groovy = Java Tech + Ruby + Python for the JVM session. This is a simple equation that makes a lot of sense to me, especially since I develop a lot of Groovy scripts at work. This session was a 101 introduction to groovy. Rob Cope of OpenLogic did a great job at describing the dynamic aspect of Groovy, Closures, Groovy Markup builders such as AntBuilder and XmlBuilder, and the the GDK extensions.

For those not familiar to Groovy. Groovy is a object-oriented dynamic language that runs on the JVM. In Groovy, static typing and semicolons are optional. Groovy has a lot of built-in features missing in Java, such as regular expressions. A great feature of groovy is that it compiles to a class file which can be used in a Java application. According to Rob, “your boss can’t tell if you are using Groovy.”

The one feature of Groovy that I was not at all familiar with was the Scriptom. Scriptom gives you access to COM objects, in a fashion that is similar to VBScript developers. Rob shows demoed Scriptom, he opened Microsoft Excel added values, created a chart, saved the chart to the file system, created a JFrame with a button that use the chart as an icon. More amazing is that he did this without restarting or closing or rebuilding anything.

I am seriously thinking of replacing all our VBscript dependencies from our application. We use VBScript to open and print Word and Excel documents. With Groovy and Scriptom I could do this in the JVM.

Technorati Tags: , , , , ,


May 17 2006

Dos and Dont’s For Swing Apps

This session was presented by Karsten Lentzsch, founder of JGoodies. Karsten said, “It’s easy to program swing … badly.” According to Karsten, the average desktop project does not have a budget for UI usability analysis. This is especially true for many Open Source projects. Krasten presented some Swing dos, like do remove clutter by writing short text labels, do remove duplicate borders, do reduce design to its core essence, do use a stable aspect ration such as 1:1 or 4:5, do add negative space. Karsten believes that white space is not wasted space. In addition, he favors space to separators.

Some dont’s include don’t use saturated colors, don’t change fonts (use native fonts and size), don’t break the icon design (use a consistent icon set).

In closing, Karsten said that “many people could do at least good layout with Matisse.”

A personal note. I saw my former instructor at SJSU at this session, Professor Horstmann. Professor Horstmann is author of Core Java.

Technorati Tags: , , , ,


May 17 2006

Design This Container

I attended the Creating Professional Swing UIs Using NetBeans GUI Builder (Formerly Code-Named “Matisse”). I been meaning to get started with the NetBeans GUI Builder to become a more productive UI developer. An important point for me is that Matisse supports custom components. This is important for me because at my company we have developed a lot of custom components. The Matisse GUI Builder is a WYSIWYG visual builder with a drag and drop feel which can be used to design an UI as oppose to developing one. Of course UI builders are great to quickly prototype an application.

The NetBeans UI Builder reminds me a of XCode’s Interface Builder. An IDE has context help, and UI Builder, like Interface Builder, have alignment help. With both these tools, UI design becomes an art rather than a science. At the end of the session one of the speakers simple summed up the session as, “Hand coding bad, Matisse good.”

Here is a good design practice when using the NetBeans UI Builder: Design every container as resizable.

Technorati Tags: , , , ,


May 17 2006

Web Service With Eclipse

The name for this session almost reads like a run on sentence: Create, Test, and Consume Web Services with the Eclipse Web Tools Project. This session covered the new features in the Eclipse Web Tools Project. The audience was shown how to use the multiple web tools wizards in Eclipse to create, test, and consume web services. Eclipse comes with a Web Service Explorer which can be used to test a web service.. The speaker did make it seem easy but I feel that their might not be enough online documentation.

One note about this session. I was surprised that this speaker, speaking on the subject of web services and SOAP, did now know or heard of REST. More than anything this speaks to the amount of technology that a typical Java developer needs to be familiar. A typical J2EE developer needs to be well versed in so many underlying technologies and web services is a example of this.

Technorati Tags: , , , , ,


May 17 2006

Effective Java Reload

Joshua Bloch wrote the seminal book Effective Java. That is one book that needs to be in your Java bookshelf. Joshua does not have a new edition of Effective Java but in this session he shows effective use of some of the new Java 1.5 features, such as Generics. Here are some blurbs from the Effective Java Reloaded session.

Static factories have advantages over constructors. You should strive to minimize mutability. Use the Builder pattern to emulate named parameters. Optional parameters will require a setter method in the builder class. Have build method in the Builder class that will actually create the instance of the class you are building. Avoid raw object types, use generics. In generics, prefer wildcards to type parameters. Wildcards are good in you API as parameters but it is a bad design to return a generic with a wilcard. According to Joshua, returning a wildcard generic smells like bad code. Generics and arrays don’t mix, prefer generics. Here is a mind expanding pattern: THC, that is Typesafe Heterogeneous Container. And finally, final is the new private. Joshua stated, “get used to typing private final.”

This was a great session lead by a great developer.

Technorati Tags: , , , ,


May 17 2006

Java One Tuesday: General Session

Thomas Kurian, Senior Vice President, Oracle Server Technologies Development at Oracle gave the morning general session today. The key to note about Thomas’ presentation is hard at work with an implementation of the EJB 3.0 specification. Thomas stated that the Oracle EJB 3.0 implementation has been donated to the Open Source community. Thomas eagerly believes that EJB 3.0 will simplify enterprise development, he said that anyone that can develop a POJO will be a J2EE developer. It seems that the EJB 3.0 spec defines an enterprise bean as a POJO with annotations.

Technorati Tags: , , , , ,