Chapter 62. Applied Cairngorm

Flex applications built using Cairngorm usually contain a number of regular parts, including a front controller, model locator, service locator, and a collection of business delegates, Cairngorm events and commands. This chapter examines each of these parts in more detail, explaining their purpose with reference to a sample application, the Cairngorm Store.

The last chapter provided a whistle-stop tour of Cairngorm, racing from user gesture to view update, with no time for deeper considerations. This chapter aims to address those shortcomings by examining each part of Cairngorm in detail, explaining its purpose and recommending the best way to make use of it while avoiding common pitfalls.

The largest section is concerned with the model locator and the model itself. This is because much of the complexity of large Cairngorm applications resides within the model, yet neither Cairngorm nor any of the other popular Flex frameworks provides much guidance for object modeling. After this, the other aspects of Cairngorm, including Cairngorm events, commands, business delegates, service location, and value objects are all covered.

Throughout the chapter, reference is made to the Cairngorm Store application. The source code for this simple Cairngorm application accompanies this book.

Getting Started

Most of the sections that follow make reference to classes within the Cairngorm Store application. Therefore, you should compile and run the Cairngorm Store project prior ...

Get Professional Adobe® Flex® 3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.