Friday, October 21, 2011

Fowler's GUI Architectures


I re-read Martin Fowler's GUI Architectures article over the past couple of days. It's interesting in that it describes MVC as it was originally conceived for Smalltalk. Fowler describes this and its immediate derivatives very well. However, when he gets to the various flavors of MVP, the tone changes. It almost feels like he got tired of writing the article, which I can understand as I got tired of reading it and had to take it in multiple sittings. However, the lack of thorough illustration of the MVP varieties is a little disappointing after working through the rest of the article.

One thing that he does is describe the various architectures in terms of more fundamental patterns, such as Observer Synchronization, Presentation Model, and Supervising Controller. These seem to me to be the really valuable nuggets of information. You can think of each architecture as a combination of these fundamental patterns such that it fits the programming environment, specifically the capabilities of the source language(s) and runtime.

This is where the later applications of these UI architectures breaks down -- the UI architectures were designed specifically for the programming environment. It is unlikely that when you change some aspect of the programming environment, such as the source language, that the same UI architecture will be optimal. It is inevitable that some of the constituent patterns will be modified, substituted, or removed.

From here, I need to read more detail about the patterns and explore some of the further reading. Then, I can truly evaluate UI frameworks, not for the architecture that they claim to follow but for which patterns they use and well they fit in the environment that I'm working in.

Tuesday, February 15, 2011

Frustration with GWT 2.2 Upgrade

First, I'll admit that, as a developer on an open-source utility for GWT (gwt-multipage), I probably should have tried out the builds of GWT 2.2 before the final release. However, I'm to not the only one who wasn't prepared.

Many people seem to be struggling with upgrading their applications to GWT 2.2. A common theme seems to be when the application uses a code generator, either directly in the application or indirectly by making use of something like GIN. It seems that GWT 2.2 introduces a binary incompatibility with code generators by changing some classes to interfaces. Therefore, when upgrading the GWT jars to 2.2, you also have to upgrade the jars of any libraries that use code generators to versions that have been compiled against 2.2.

I mentioned that I'm the only one who wasn't prepared. GIN, a project maintained by Google employees, does not have a build ready. They even seem to still be debating how to manage the releases to provide compatibility with GWT <= 2.1.1 and >= 2.2. The google maps API jar, part of the gwt-google-apis project, is also affected.

That's what I know so far about the problem. I'll try to post what I know about the solution once I get a chance to experiment with it some more.

Tuesday, January 4, 2011

Running a Simple Ext GWT Application

Now that the holidays are over, I'm finally getting started with Ext GWT 2.0 Beginners Guide. I got the initial sample application running, but it took a little bit of doing.

For starters, I'm using IntelliJ IDEA (on Mac OS X 10.5, for the record), not Eclipse as suggested by the book. This wasn't too much of a problem. I only had to know how to:
  • set up the GWT SDK
  • add a global library for GXT
  • create a GWT project
Having the GXT library set up, I did not need to copy gxt.jar into war/WEB-INF/lib, and frankly I'm surprised that this is necessary in Eclipse; I may have to try that myself. I did, however, have to copy the GXT resources into my project as the book suggested. This also surprised me, but that's not the fault of the book. I'll have to check the official Ext GWT documentation to see if they take the same approach.

Finally, I thought I had everything set up and fired up development mode. When running the GXT version, it would crash with the error:
Invalid memory access of location 0x8 eip=0x4245eb
I switched back to the original non-GXT entry point and it worked fine. I finally realized that the one other difference in my project was that I had forgotten to change the Java SDK to 1.6. To be fair, the book says to use Java 6. I just didn't realize that it wouldn't work with Java 5.

What's the moral of this story? I'm not sure. I'm just glad it only took me 30 minutes to figure out, which I think is pretty fortunate given the obscurity of the error message.