Chapter 1: Introducing Cairngorm
11
The “ Flex 3: Introducing Cairngorm ” article outlines several benefits of using Cairngorm. These include:
Cairngorm is ideal for team development, since it allows designers, component developers, and
data - services developers to work in parallel.
Maintenance, debugging, and the adding or updating of features are easier than with a project
created using just the standard Flex framework.
Both of these benefits arise from the organization provided by the Cairngorm framework.
Since code is organized by roles/responsibilities and is implemented via the Cairngorm methodology,
designers can be working on views while component developers and service developers work on their
respective parts. When these pieces of code are brought together into the application you can be pretty
sure they will be compatible, since they are all using the standards defined by the Cairngorm framework.
This allows application features to be developed in parallel, shortening development timelines.
Maintenance, debugging, and the adding or updating of features become easier because you know where
to look to find the code related to a given feature. If you have ever developed an application in Flash, or
looked at one developed by someone else, you most likely have spent time searching for code, since it
can be spread across frames or hidden in deeply nested movie clips. The same situation can occur in Flex
if code is scattered across the application or application components. However, when using Cairngorm
you can quickly track down specific code because of the predictable way Cairngorm handles application
logic. If you see that a view is dispatching a given event, you can look for the command registered for
that event in the FrontController and quickly see what logic the command is triggering. Adding and
updating features are simply matters of modifying existing Cairngorm classes or adding new ones.
Summary
In this chapter you were introduced to the Cairngorm framework, including its history, guiding
principles, major components, application logic flow, and organization.
Cairngorm promotes the separation of code by roles/responsibilities and facilitates team development,
in that different parts of the application can be worked on in parallel.
As I mentioned in the history section, Cairngorm borrows many of its solutions from the J2EE world. If
you are coming from a computer programming background or have previously worked with Java or
some other object - oriented language, many of these solutions may be familiar to you.
If you are coming from more of an ActionScript development background, they may be less familiar,
since ActionScript is a less rigid language than Java and standards and practices still vary greatly in the
world of ActionScript development.
Regardless of your current experience, the beginning chapters of this book discuss the underlying
principles that inform Cairngorm and look in more detail at the major components defined in this chapter.
After examining these components, you will complete a brief sample application so that you can see
examples of how these components work together to form application features.
Once you have completed the sample application, criticism and best practices related to Cairngorm will
be discussed, as these will be more informative after you have worked with the framework.
❑
❑
c01.indd 11c01.indd 11 10/20/09 12:26:43 PM10/20/09 12:26:43 PM