O'Reilly logo

Professional Adobe® Flex® 3 by Joe Berkovitz, David Hassoun, Andrew Trice, Tom Sugden, Todd Prekaski, Jun Heider, Peter Ent, Joseph Balderson

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

Chapter 63. Advanced Cairngorm

This chapter contains advice to help you build on the foundations of Cairngorm. It is targeted at developers with an understanding of traditional Cairngorm and consists of the best practices, anti-patterns to avoid, and useful customizations.

Although Cairngorm provides a framework on which to build a Flex application, the quality of the end result depends on many other factors, including:

  • Testability: If code cannot be tested easily, how can a developer be sure that it works?

  • Organization: When a project grows rapidly, how can the codebase be kept tidy and navigable?

  • Dependencies: If dependencies are not minimized, software becomes difficult to maintain.

This chapter addresses these issues. The first section explains how to use Cairngorm in conjunction with the Presentation Model pattern to move view logic into a place where it can easily be unit tested. Guidance for organizing smaller and larger Cairngorm projects follows, before a number of known Cairngorm anti-patterns are exposed; these tend to occur in Cairngorm projects but are easily avoided with a little care and attention. Finally, the topic of customization is covered, including extending the front controller for various purposes, timing the execution of commands, and stubbing the service layer.

The Presentation Model Pattern

The Presentation Model is a design pattern for user interface programming that is particularly well suited to Flex, since it can take advantage of language features such as ...

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