September 06, 2007

WiMIC Browser v.2 – migrated to Adobe Flex Cairngorm application framework

Follow-up to WiMIC Browser – my first big Flex application from Transversality - Robert O'Toole

WiMIC Browser is a Flash based rich internet application that gives online access to an extensive biographical and bibliographical database. It was originally built in Flex 2.0 using a home grown MVC application framework. I have now migrated it into the Cairngorm framework, a process that took about six days.

The application behaves just as before, but the plumbing behind it has been rationalised and improved using Cairngorm. The project now looks like this in the Navigator:

WiMICBrowser 2 Navigator

The migration was quite straightforwards. The design of the original app was quite similar to that of a Cairngorm app. However, the framework offers a few neat tricks:

  1. A simple and easy to understand event based controller. Views can initiate events, which are then passed onto the required command by the controller. Once the event is called, the originating view is forgotten about.
  2. The AppModelLocator singleton, which gives access to centrally stored value objects. Elements in views are bound directly to value objects and properties in the model. If a command updates the model, then changes are made to the bound elements.
  3. In this app, tab navigators are used to contain the various views. The TabNavigator.selectedIndex property of each tab navigator is bound to a property in the model. That means that a command can change the currently displayed tab by changing the relevant property in the model.
  4. Chaining of commands – a command can call another command. For example, when viewing a single publication record, the GetSinglePublication command calls further commands depending upon the type of publication that is being viewed.
Most importantly, my code is now much easier to understand and to develop further. As Cairngorm is a widely understood and documented framework, it will be easily understood by other developers.

- No comments Not publicly viewable


Add a comment

You are not allowed to comment on this entry as it has restricted commenting permissions.