Last modified 11 years ago Last modified on 01/12/07 09:18:41

Making AJAX MindSeer


An AJAX version of MindSeer involves 2 steps:

  1. Make all SwingHTMLObjects produce something AJAX compatible.
  2. Develop a custom client module that produces AJAX objects for the client UI and runs in a Servlet container (like Tomcat)

Step 1

There are a number of options for making SwingHTMLObjects produce AJAX compatible objects.

  1. Have each SHObject produce HTML strings. There is already a method stub for doing this. I wouldn't recommend this -- its error prone and will require extensive browser testing. The reason it was included in my API is that at the time, the next 2 options weren't in a very strong state (or available).
  2. Have each SHObject produce a Google Web Toolkit object. This is probably the best option as Google likely won't let this project die and because it is under Apache License, it probably won't have any bad consequences.
  3. Implement the parameter code and have an AJAX interface automatically generated from parameters.

To quickly develop this, I'd personally lean towards option (2) for the following reasons: Pros

  1. Eliminates the need to debug on multiple browsers. AJAX is finicky and asynchronous interfaces require a more familiarity with control flow between threads than most people have or want.
  2. Google won't let this project die because it fits in with their current corporate strategy. This means frequent updates.
  3. Open source
  4. We may be able to get Google to do some free showcasing to brag about their toolkit.


  1. There is a chance the next version will be closed (unlikely)
  2. There have been privacy concerns because it phones home.

I think a better approach would be (3) because it would ease plugin development, provide all of the inherent benefits and would allow the AJAX implementer to create interfaces that work the best in the web browser.

Step 2

This step is a little more involved. A good deal of the client already uses SHObject's, so you might be able to drop these into your interface. Other bits won't translate as well. Once again there are multiple options available:

  1. Make a custom client that fits in well with the web -- this will involve developing a custom ClientManager?, menus, a data set viewer and a custom workspace layout. This option may be the most robust and will offer the most freedom.
  2. Try writing an AJAXLayoutManager (extends LayoutManager?) and debug everything. This option may be the fastest and there is a chance that it will work well out of the box.
  3. Make a custom ClientManager? and an AJAXLayoutManager. Tweak the interface using the ClientManager? and reuse most of the code through the AJAXLayoutManager.

The options here are more of a tossup. Option 2 will likely be the fastest. I'd personally do Option 3. For the custom ClientManager?, I'd do the following simple design changes:

  1. abstract all shared code from current ClientManager? into a new class AbstractClientManager?
  2. Make the current ClientManager? extend AbstractClientManager? and probably rename it to RMIClientManager
  3. Make the new ClientManager? extend AbstractClientManager? and name it AJAXClientManager.

The next step would be to create a new launcher class. This class would likely be a helper that is called by a Servlet that has no session.

There will likely be other boilerplate Servlets needed to make everything work.

Finishing Up -- to embed or not to embed

To get a Session object, the final system could either include its own embedded MindSeer server (similar to Standalone) or could call a remote server (like the current client). The advantage of embedding the server is purely performance. The system will likely be noticeably faster and may be a little less error prone. Running the AJAX server as a client allows for more distributed resources and would make it easier to have a hybrid of clients going to the server. I'd personally embed it, the performance gains would be worthwhile and we could run another server on a different machine for users of the Java Client.