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

10.2. Summary

In this chapter you examined how the pieces of Cairngorm work together by examining a simple login application. The basic Cairngorm logic flow and corresponding classes from the sample application can be seen in the table below:

Cairngorm Logic FlowSample Application Class(es)Triggered By
Cairngorm event is broadcast.LoginEvent, LoginForm viewThe user clicks the Login button.
The FrontController intercepts the event, locates the corresponding command, and triggers the execute function.LoginControlThe Cairngorm event is dispatched.
The command class decides how to handle the event. This may be by simply updating the ModelLocator, or by calling a remote service, perhaps using a delegate.LoginCommandThe FrontController finds a command class for the event and calls the execute function.
If a delegate is being used, it contacts the service and registers a responder.LoginDelegateImplemented by a command class that calls the desired function.
The command class updates the ModelLocator with any data from the remote service, or updates it based on the success of the remote service call.LoginCommandThe responder functions are triggered when the remote call has completed.
The ModelLocator notifies views of changes via data binding.CairngormLoginModelData binding triggers updating of views.

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