Ted's Tidbits

ThinWire 1.2 Release Candidate 2 Available Now

ThinWire, the framework that provided my acclaim in the technology space, has just announced Release Candidate 2 of version 1.2 with promises of a final release within the week. This is very exciting news for anyone that uses the framework. It continues to get better and better over time. Congratulations Josh!

Download Link

Blatant and Shameless Book Promotion

Yesterday at OSCon, Prentice Hall announced the launch of the Sourceforge Community Press.  It is a special line of eBooks (called Shortcuts) that feature open source projects and are written by the developers themselves.

It is my pleasure to announce that one of the four titles available at launch is the ThinWire Handbook: A Guide to Creating Effective Ajax Applications, co-authored by yours truly.  It is available now for the price of $12.99 as a downloadable PDF, and it is also available through the Safari Bookshelf.

In the book, Josh Gertzen and I provide an overview of the entire framework.  Our goal is to describe the essence of each piece that makes up the complete framework, as well as to document features that may not be obvious to most developers.  So, if you’re into that sort of thing, go pick up download a copy, and start learning the awesomeness that is ThinWire.

Safari 3 For Windows -- First Impressions

As soon as I heard the announcement, I downloaded the public beta of Safari 3 for Windows.  So far I'm pretty impressed.  The memory usage seems to come in between Firefox (the worst) and Opera (the best).  ThinWire, my web application framework, works beautifully.  Gmail works fine, but Yahoo Mail has some issues (I get lots of JS errors).

I did a quick performance benchmark.  ThinWire has a Grid component that can display lots of data.  I fired up my benchmark app for the Grid, and added 10,000 rows.  Here's the performance results:

  • Internet Explorer 7: 1 minute 33.66 seconds
  • Opera 9: 27.93 seconds
  • Firefox 2: 23.24 seconds
  • Safari 3 Beta: 18.91 seconds
I realize that there is only approximately a 4 second improvment over Firefox 2 in this test, but 4 seconds is a lifetime in terms of waiting for a web application to load.

Also, while the Grid was loading, the rest of the app was still responsive; I could even start browsing and scrolling the Grid.Also, a quick look in the install directory reveals some interesting libraries.  WebKit was there as expected, but also CoreFoundation (Apple's base C library) and CoreGraphics (the main OS X graphics library).  Very interesting.

Effective AJAX for Everyone 'Including the Enterprise'

Effective AJAX for Everyone ‘Including the Enterprise’

Like the rest of us developers out there, you’ve probably been captivated by the promises that AJAX and Web 2.0 make. Sure, there’s a great deal of hype surrounding any new technology wave, but somehow this feels different. For the first time since the Web application made its debut, there’s a real sense that a new paradigm shift is upon us.

ThinWire and Helmi To Cooperate

From AjaxWorld:

Helmi Open Source RIA Platform and the CCS ThinWire Solution To Be Integrated

‘Working with CCS enables both companies to go to market with a robust AJAX solution for our customers,’ said Juho Risku, CTO and founder of Helmi Technologies, as Helmi announced this morning at AJAXWorld Conference & Expo 2007 East in New York that they have joined forces with Custom Credit Systems (CCS), developer of the ThinWire RIA Platform, to deliver an integrated client-server AJAX solution.

Update

Well, its apparently been over 2 months since I last posted anything to the ol’ blog.  The last think I wrote about was the late night release of ThinWire 1.2 RC 1.  So much has happened since then.  Instead of writing about everything, I’ll just list stuff that’s happened since then:

  • Two snapshot releases of ThinWire have been made.
  • I attended three weddings in three cities in three weeks.
  • I finished reading Asimov’s Foundation novels.
  • I attended a midnight wedding.
  • My printer broke.
  • Megan and I celebrated one year of marriage.
  • I purchased an iPod.
  • Epson sent me a brand new printer.
  • I read the New Testament
  • My company purchased additional office space.
  • I replaced the brake pads on my car.
Here’s what I haven’t done since the release of RC1:
  • Get a haircut.
See you in April!

Thin is In

Early last Friday morning, we released the latest version of ThinWire (1.2 Release Candidate 1). Since then, it’s been very interesting and exciting to watch the reaction.

First of all, there actually was a reaction to this release. Nothing of significant note happened after our previous releases, but this one was different.

  1. Our SourceForge rank has been bouncing all over the place. On Friday night it was 12, Saturday night it fell to 13, Sunday night it rose to 8, and last night it fell back to 12.
  2. Our download count is heathier than ever. We had over 200 on Friday. We exceeded 178 yesterday, and we’re already above 140 this morning.
  3. Other people are talking about us:
    1. http://evolutionarygoo.com/blog/?p=70
    2. http://ajax.sys-con.com/read/312936.htm
    3. http://www-128.ibm.com/developerworks/edu/wa-dw-wa-thinwire1.html?ca=drs-
It’s all very exciting. For more info, check thinwire.com.

Creating and Debugging ThinWire Applications with Eclipse

This tutorial will walk you through the creation of a simple Rich Internet Application with ThinWire using Eclipse 3.2 (Callisto) and the Eclipse Web Tools (WTP). It will also show you how to use these tools to debug your ThinWire application.

NOTE: Neither Eclipse nor the WTP plugins are necessary for ThinWire development. There are also other methods of using Eclipse to debug your ThinWire application that don’t require the WTP, but this currently appears to be the most straight-forward approach.

Configure the Development Environment

To follow this tutorial, you must have Eclipse 3.2 and the WTP installed with Apache Tomcat installed and configured. Below is a quick summary of the steps necessary. For more information see http://www.eclipse.org/webtools/.

  1. Download and Install Eclipes 3.2 (Callisto) from http://www.eclipse.org/downloads/
  2. Load Eclipse, Help –> Software Updates –> Find and Install…
    1. New Features –> Callisto Discovery Site
      1. Check “Web Standard Tools (WST)” and “J2EE Standard Tools”
      2. Click “Select Required”
  3. Download & Extract Apache Tomcat from http://tomcat.apache.org/download-55.cgi
  4. In Eclipse, Window –> Preferences
    1. Server –> Installed Runtime Environments
      1. Click Add
      2. Choose Apache –> Apache Tomcat v5.5
      3. Click Next
      4. Set Tomcat Installation Directory to the location you extracted the Tomcat archive
      5. Click Finish
  5. Switch to the J2EE Perspective
  6. Window –> Show View –> Servers
    1. Right-Click –> New –> Sever
    2. Hostname = localhost
    3. Server Type = Apache –> Tomcat v5.5 Server
    4. Runtime = Apache Tomcat v5.5
    5. Click Finish

Create a ThinWire Project

Once you have Eclipse installed and configured, you can create your new project. Open Eclipse and switch to the J2EE Perspective. Then right-click on the Project Explorer and select New –> Project.

tutorialdebugging1.png

Choose Web –> Dynamic Web Project and click Next.

tutorialdebugging2.png

Set the project name to SimpleApp and make sure the Target Runtime is the Apache Tomcat that you set up in the configuration. Click Finish. Eclipse will create the project for you. If this is your first web project, you may have to accept a license agreement.

tutorialdebugging3.png

If you haven’t already done so, download the ThinWire SDK from http://www.thinwire.com/download.html. Extract the zip archive, and copy the tree JAR files from demos/playground/WEB-INF/lib (thinwire.jar, retroweaver-rt.jar, commons-fileupload-1.0.jar) to $ECLIPSE_WORKSPACE/SimpleApp/WebContent/WEB-INF/lib (where $ECLIPSE_WORKSPACE is the path of your Eclipse Workspace).

tutorialdebugging4.png

Back in Eclipse, right click on SimpleApp in the Project Explorer and choose Refresh. The three JAR files should now appear under Web App Libraries.

tutorialdebugging5.png

At this point you should have a Dynamic Web Application Project with the ThinWire Runtime and support libraries. Let’s write some code.

Creating the ThinWire Application

Right-click on Java Resources: src and choose New –> Package.

tutorialdebugging6.png

Make sure the Source folder points to SimpleApp/src and set the package name to thinwire.apps.simple. Click Finish. Right-click on the thinwire.apps.simple package and choose New –> Class.

tutorialdebugging7.png

Make sure the Source folder and Package are correct. Call your new Class Main and check the box to create the public static void main(String[] args) method. Click Finish. Eclipse will generate the following java code in a file called Main.java:

package thinwire.apps.simple;

public class Main {

    /**  
    * @param args  
    */

    public static void main(String[] args) {

    // TODO Auto-generated method stub

    }
}

We’re going to create a simple application that presents the user with a Dialog asking for their name. When the user types their name anc clicks the OK button, the Dialog closes and another Dialog appears to greet the user by name.

The first thing we need to do is import the ThinWire UI Package and the ThinWire Event Package:

package thinwire.apps.simple;  
import thinwire.ui.*;  
import thinwire.ui.event.*;

public class Main {  

The thinwire.ui package contains the classes for all of the user interface components provided by thinwire. ThinWire contains over 20 components, but for this application will will be using only Divider, Label, TextField, Button, and MessageBox. The thinwire.ui.event package contains the event listeners for the UI components. In this application we will be using an ActionListener with a Button.

The creation of a ThinWire web application is very straightforward and is very similar to creating a standard desktop application. Basically all we do is:

  1. Create new instances of Dialog, Label, TextField, and Button,
  2. Set the Text of the Label to somethin descriptive,
  3. Add an ActionListener to Button,
  4. Add the Label, TextField, and Button to the Dialog
  5. Display the Dialog

The code looks like this:

public static void main(String[] args) {  
    final Dialog dialog = new Dialog("Simple ThinWire Application");
    
    // The position of the Dialog is relative to the browser  
    dialog.setBounds(25, 25, 215, 210);  
    Label label = new Label("Hello, what is your name?");
    
    // The position of the Label is relative to the Dialog  
    label.setBounds(5, 5, 200, 25);
    
    // the Dialog and TextField are declared final so they can be  
    // refereced inside the Button's ActionListener  
    final TextField input = new TextField();  
    input.setBounds(5, 35, 200, 25);
    
    Button button = new Button("OK");  
    button.setBounds(55, 65, 100, 25);
    
    // When the button is clicked, close the dialog and greet the user  
    button.addActionListener(Button.ACTION_CLICK, new ActionListener() {  
        public void actionPerformed(ActionEvent ev) {  
            dialog.setVisible(false);  
            MessageBox.confirm("Hello " + input.getText() + "!");  
        }
        
    });
    
    dialog.getChildren().add(label);  
    dialog.getChildren().add(input);  
    dialog.getChildren().add(button);
    
    dialog.setVisible(true);  
}  

Once you have finished typing your code, save the file.

Configuring the ThinWire WebServlet

Now, we need to configure the web app. In the Project Explorer, expand the Deployment Descriptor tree element. Right-click on Servlets and choose New –> Servlet.

tutorialdebugging8.png

Check the box next to Use existing Servlet class. Click Browse and choose WebServlet. Click Next.

tutorialdebugging9.png

Add two Initialization Parameters:

Param1 (the name of the class with the main method):

name = mainClass

value = thinwire.apps.simple.Main

Param2:

name = extraArguments

value = initParam,clientInfo,header

Select the only URL Mapping in the list, click Edit, and change it to “/” (without the quotes). Click Next.

tutorialdebugging10.png

Uncheck all the boxes and click Finish.

Eclipse then writes this configuration information to WebContent/WEB-INF/web.xml. Your servlet is configured. Let’s run the app.

Run the Application

Right-click on SimpleApp in the Project Explorer and choose Run as –> Run on Server

tutorialdebugging11.png

Make sure that the Tomcat server you configured is selected and click Finish. Eclipse then starts Tomcat and launches a browser pointed to your web app.

tutorialdebugging12.png

We have a Dialog with a Label, TextField, and Button. You can drag the Dialog around the screen if you like. Type your name in the TextField and click the Button.

tutorialdebugging13.png

The MessageBox component functions like a JavaScript alert (although you can do more with a MessageBox such as include an image, display multiple buttons, and include any ThinWire component). When you click OK, the MessageBox closes and the app is done. Back in Eclipse, right-click on the Tomcat Server and choose Stop.

Debug the Application

This is a very simple application, but in the case of more complex web applications, you may need some assistance in debugging your code. Since a ThinWire application is written in pure Java, we can fully utilize Eclipse’s built in debugger.

In the code editor pane, find the first line of code that executes in the main method, and double-click in the left margin. A blue dot appears in the margin indicating a break point has been inserted. Now, right click on SimpleApp in the Project Explorer and choose Debug as –> Debug on Server. Click finish. Again Tomcat starts and the browser is launched. This time, Eclipse comes back into focus in the debug perspective. You may now step through the execution of your app as you watch the variables change.

tutorialdebugging14.png

When you’re done debugging, close your browser and stop the server.

Export the Application as a WAR archive

There’s only one more thing left to do: deploy the application. Eclipse WDP makes this extremely easy. Just right-click on SimpleApp in the Project Explorer and choose Export –> WAR file.

tutorialdebugging15.png

Choose a name for your WAR file and Eclipse will create the archive ready to be deployed onto any Java Servlet Container.

This is just one method for creating ThinWire Rich Internet Applications. We took advantage of several advanced features of the Eclipse Web Tools Project, but really the only things a developer needs to create a ThinWire application are the ThinWire library JAR files, a Java complier, and a text editor. The only thing you need to run a ThinWire application is a Java servlet container. With ThinWire, creating Rich Internet Applications are as simple as creating desktop GUI applications.

The Secret of JavaScript Class Inheritance and Polymorphism

While there are many methods that attempt to make JavaScript into an Object Oriented Language, most fall short when it comes to the ability to call methods on parent classes. This article analyzes several broken approaches, including the famous one by Douglass Crockford, and then presents a working solution.

read more | digg story

ThinWire v1.2 beta2 Released

After several weeks of hard work, the next beta has been released.  You can read all about it at the ThinWire Blog.  The main two things are the ability to change the style of each component or the entire application at a global level through a properties file, and a major performance enhancement minimizing client-server traffic.

My main contribution to this release is the RangeComponent interface and two component implementations of this interface: Slider and ProgressBar.  The progress bar is very useful for providing feedback to the user while your application is doing some sort of processing.  The slider is used for selecting a numeric value from a specified range of values.

As this release was mainly about style, I have revamped the look of ThinWire Mail (my demo application built in my spare time).  Today we are also announcing live demos of ThinWire, so you can click here to try out ThinWire Mail without having to download anything.

ThinWire Mail Demo

Playground Demo

Download ThinWire v1.2 beta2 SDK

Discuss: When is it appropriate to use applets?

Last night my wife was enrolling in her university’s health insurance plan.  The insurance company’s website committed one of my biggest web development pet peeves: using a Java applet for a navigation menu.  This brings up my question: when is it appropriate to use a Java applet on your web site?  I’d appreciate your responses in the comments thread.

(As a side note, it was also very poorly implemented.  I got an error saying that I needed to make sure Java was installed for Internet Explorer on my version of Windows.  We were using Safari on the Mac!!)

Wikipedia is Strict

In one of my web searches for ThinWire and Ajax frameworks, I stumbled upon Wikipedia articles about some other frameworks. I decided that if these other frameworks deserved articles, then so did ThinWire. In an attempt to get something up there quick, I used the text from our submission to Ajax Patterns. Within minutes, it had been flagged as a copyright violation. Despite my protests and claims that I authored both the Ajax Patterns and Wikipedia article, it was deleted.

My second attempt involved copying the text from the ThinWire.com site into an article. This submission was flagged by an editor as advertisement (which is technically true). Today I rewrote the article, making it more objective and less of a sales pitch. I then invited other people to download the framework, and add their more obective analysis to the article. I was reprimanded by the editor again because apparantly original research is not allowed in a Wikipedia article. But the artcle remains because I qualify as an expert on the subject, and expert writings are allowed. Those guys are strict!

SourceForge Sucks

I know what I just said is considered blasphemy, but it’s the truth.  SourceForge is the undisputed king of Open Source project hosting.  They provide Free and Open Source (FOSS) projects much needed tools like bug tracking, mailing lists, forums, and download mirrors.  They also collect activity statistics so that project managers know how many people are visiting the project page, downloading the software, etc.

Being hosted on SourceForge is great from a marketing perspective as well.  Having your project listed on SourceForge gives it a sense of legitimacy in the open source community.  Project managers can publish press releases and news articles to appear in SourceForge’s main news site.  Also the projects with the most activity get listed on the home page.  Sounds good,  right?

Well, the feature list is excelent, but SourceForge has a lot of technical problems.  I haven’t been able to check any project statistics for 3 days now.  There were 2 full days this week where the site was completely down, and then when it came back up no one could log in.  The tools themselves (with the exception of the download mirrors) are all pretty weak.  There are much better (free) alternatives to the SourceForge provided tools.

Having said all that, I realize that we will probably stay with SourceForge.  Brand loyalty is very strong even in the open source community.  There are better services out there now, but SourceForge was there first, and that’s why they have over 100,000 open source projects hosted with them.  I can deal with some sub-par admin features, I just hope they can become more reliable.

Working on an Open Source Project

The past few weeks have been very interesting at work. It has been frustrating to be without my website because I’ve had many things I wanted to write about. It’s been about two weeks since we released ThinWire under the GNU General Public License. Since then, it has been a new experience watching the project slowly grow. Every day we look to see if someone has reviewed it. So far only this Japanese site has written a review. Since I don’t speak Japanese, and the Google Translator is less than helpful, we’re not really sure if they like it or not.

This past week, we joined the thousands of open source projects on SourceForge. We’re now able to accurately track downloads, which are growing by the day. SourceForge does a good job with download mirrors. Their other services are lacking. (I’ll probably have more to say/rant about this later)

This is a new experience for me and for my company. I’ll continue to chronicle the open source journey here. If you haven’t checked out ThinWire, you should go download it. It has the potential to change the status of web applications.