O'Reilly logo

Professional Cairngorm™ by Jeremy Wischusen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

1.4. Basic Cairngorm Logic Flow

Now that you have a sense of the major components that make up Cairngorm, the following is a broad overview of how logic is implemented in a Cairngorm application.

The basic chain of events in a Cairngorm application can be seen in Figure 1-1.

Figure 1.1. Figure 1-1

A view (or in some cases some other event, such as the loading of the application) dispatches a Cairngorm event. When this occurs, the FrontController intercepts the event and triggers the command class registered for that event. At this point the command class can do one of several things.

If no communication with the backend is required, the command may simply update the ModelLocator, causing the views to be updated via data binding.

If delegate classes are being used, a function on the delegate class will be called to perform actions on the backend via a remoting class found in the ServiceLocator. In this case the command acts as a responder to the remote call by registering itself with the delegate class. When the delegate function completes its call, the command class is passed the status of the call and any data returned from it via responder functions.

If the command class is directly calling the remote service, it performs the lookup on the ServiceLocator class and directly registers itself as a responder on the remote service. Once again, the results of the call are handled ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required