May 19 2006

Rich Client Platforms

The session Test Driving the Rich Client Platform by Mikael Boman was really informative. I been looking into the Eclipse RCP and have also been reading a lot about the NetBeans Platform. In this session, Mikael discussed the NetBeans Platform, the Eclipse RCP, the Spring RCP, and the alternatives for building a rich client application.

A Rich Client Platform like the Eclipse RCP helps an application developer by proving a proven application UI with most of the plumbing already wired. The Eclipse RCP has a large user base and has been well tested by a myriad of applications. By getting all this for free you, as an application developer, have more time to focus on the business logic. If you think about it, the Eclipse IDE is just a collection of plug-ins. The IBM RAD tool is basically Eclipse with a ton of plug-ins. As a positive, the Eclipse RCP counts on the SWT native UI library and hundreds of available plug-ins. The SWT is also one of the negatives for the Eclipse RCP. SWT is a competing technology to Swing and it is not 100% Java. According to Mikael, you can use Swing but will have some difficulty in some configurations.

According to Mikael, the NetBeans Plaform benefits from being 100% Java. A ton of existing modules already exist which you might be able to reuse in your own application. As for the negative aspects of the NetBeans Platform you can include the lack of documentation and the complexity of the platform.

The Spring RCP provides data binding and validation to the framework. The Spring RCP supports Swing and is feature rich. The problem with Spring RCP is that there is no documentation available for it at this time.. The Spring RCP framework is not mature and at this time if you use it you will have to do a lot of hand coding. Basically Mikael recommends that the Spring RCP is only for the brave.

Mikael’s final conclusion was to “build on what you know.” If you are using Eclipse and are developing SWT then the Eclipse RCP is for you. If you are developing Swing then maybe the NetBeans Platform will be a viable option.

I stopped at the bookstore at JavaOne after this session and noticed that you can get started with the Eclipse RCP with the help of three books. The SWT: The Standard Widget Toolkit, Eclipse: Rich Client Platform, and Eclipse: Building Commercial-Quality Plug-ins. These books are from the Eclipse Series by Addison-Wesley. I didn’t see any book that will help to get started with the NetBeans Platform and that to me speaks volumes.

Technorati Tags: , , , , ,


May 18 2006

Visual Basic And The Java Platform

This session introduced Project Simplice. According to the speakers, Project Simplice intends to attract Visual Basic programmer to the Java camp. Project Simplice is inspired by Visual Basic and compile Basic code to a class file which runs in the JVM. Basically, this makes the Java platform basically simple to the Basic programmer. The whole project is still at an early stage. The project is not available to the general project yet even. That said they Project Simplice team made some impressive demos.

As a demo, the Project Simplice imported the Visual Basic code for a calculator example written by Microsoft with the original copyright. Once imported they hit the build button to launch a program originally original written for the Windows platform but now running on JVM power. Wow. Now that is some impressive compiler magic. In NetBeans, you can edit the UI in the UI Builder and update the code and have the same context help, color highlighting, and language support that you come to expect from NetBeans.

What was hard to believe was that an exe fractal application written in Visual Basic for the Windows platform ran considerably slower than when that same code was compiled and ran in the JVM. There was general disbelief and awe when that Windows version ran over 10 times slower.

It seems that Project Simplice, or marketing eventually names it, is intended a language that can be used to teach programming to beginners.

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: , , , , ,


Apr 23 2006

Hello World Cocoa

Want to be a Mac Developer? Well, OS X and Xcode makes it easy to start hacking your ideas into Apple applications. I started to ‘write’ a Hello World program using Xcode. In less than five minutes and no coding at all I was able to create what I had in mind:

#import <Foundation/Foundation.h>

int main (int argc, const char * argv[]) {
   NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

   // insert code here...
   NSLog(@"Hello, World!");
   [pool release];
   return 0;
}

The above code was auto-generated for me by Xcode. Now only if Xcode could auto-generate the code for a new killer app that I been dreaming of.

I also want to note that the above code is a command line, Foundation Tool, application.

The @”Hello, World!” piece of code is a NSString literal. You night also have noticed that there are a lot of types that start with NS. The NS prefix stands for Next Step which is where Cocoa first started out.

Technorati Tags: , , ,


Feb 20 2006

OptimizeIt Profiler 5.0

Who said that Java does not have memory leaks? In fact I think that is a good question to ask new grads. Everyone knows that Java’s garbage collection will reclaim unreferenced objects. The problems is that some objects are still referenced even when they are no longer needed.

I been working on a memory problem and used OptimizeIt Profiler 5.0 to track it down. The version of OptimizeIt that I am using dates back to 2002 and unfortunately does not support Eclipse. I am almost sure that the latest release of OptimizeIt will support Eclipse. Without sounding too much like a commercial, OptimizeIt really helped in tracking down the static variable at fault.

OptimizeIt has a Heap view of your application. In my situation, the server had at one point 50,000 instances of one class alone. This class was not the root of the memory propblem since the class was small, but it did indicate that whoever held references to so many objects might be a place to start looking.

The Allocation Backtrace view shows where objects where created, I didn’t think this was all too useful. The Allocation Backtrace is pretty detailed and for a server object we created the allocation backtrace started all the way with TCPTransport$ConnectionHandler.run(). Even still, not that useful for what I was doing.

OptimizeIt has a great Instance Reference Graph. This feature was really helpful in tracking down who keeps references to objects thought to be disposed. The Instance Reference Graph breaks down to three tables. One table contains a ‘Reduced reference graph’, which is more of a tree than a graph, that breaks down who is holding references to objects for which you are interested. Once you navigate down the ‘Reduced reference graph’ the ‘Allocation at’ table will display a view that is reminiscent of a stack trace. The ‘Allocation at’ view will show class names and line numbers for which contain references that have references to your object of interest. Using the Instance Reference Graph I was able to narrow down the problem!

The Memory Leak Detector is great because you can create a snapshot of the heap at a moment in time so that you can compare your application’s memory usage at a later point in time. As you run your application, you may save the heap state to compare it with other saved heap states. Between two heap states, you can view the number of objects and re fences created for any class. Select a object instance and you can see a graph of objects that have references to the selected object.

As you can see, Java does have memory leaks! If your application is having memory problems you should look into using a Java profiler to analyze you application in action. I know that NetBeans 5.0 comes with a free NetBeans Profiler. I myself haven’t used NetBeans 5.0 or its NetBeans Profiler so I can’t say much about that. I am using a older version of OptimizeIt which I don’t think Borland will support so I should try to get familiar with NetBeans Profiler.

Using OptimizeIt I was astonished to discover that our application instantiates over 2 million objects from 7,000 classes. Whoa!