wiki:CairngormInContext

Cairngorm In Context

A work in progress...

Some Notes About Flex development and the Cairngorm Micro-Architecture By Robin Hilliard, CEO RocketBoots (c) 2008-2009 RocketBoots Pty Limited, All Rights Reserved

Why A Wiki?

The Cairngorm Micro-architecture has been the most widely-used framework for Adobe Flex development since Flex was released. RocketBoots has used Cairngorm from the outset and has successfully built many Flash and Flex applications over the last five years based on it.

But we don't use Cairngorm in a vacuum - it solves one problem very well, namely the separation of user interface code from supporting control and business logic, but this is rarely the only solution architecture issue we need to address. Isolating functional change, deployment flexibility, state management and many other issues need to be solved on most projects, and Cairngorm was never intended to cover all of these. Does this mean that we should look for a single, existing framework that does?

My answer is no. Every solution has different requirements, and to meet these requirements we need to be free to respond creatively with the appropriate mix of patterns, tools and code libraries at our disposal*. We have a collection of independent rules, patterns and reusable code fragments that turn up on most of our projects, and while they are not a part of Cairngorm they are certainly a part of the context in which we use it.

To get this freedom, we first need to step back from looking at individual patterns and frameworks and establish some self-evident first principles about what we're trying to achieve when we use them on our software projects. Equipped with these concepts you won't have to accept our opinions at face value - you'll be able to form your own conclusions about what will work best for your team on your project. If you don't agree with our conclusions that's great too, because by then we should have enough common ground for an interesting discussion.

Oh, And why a wiki? I've promised many people that I'd get some of the things I talk about when I teach the Flex course or consult down on paper for several years, and I thought the best way to get this done was to put it up as a work in progress. Your feedback and suggestions are most welcome - please send me an email and I'll respond when I can.

* To read some of the comments out there you'd think that software architecture is picking a framework with a ready answer for every problem you encounter and never having to make a design decision again (and in some cases using your new-found free time to start a one-eyed holy war against all the other "infidel" frameworks). This lazy, cargo-cult abrogation of responsibility meme really gets my goat when I run into it!

About the Author

Robin Hilliard is the CEO of RocketBoots, a community of seventeen RIA development companies who collaborate to deliver world-class solutions, consulting and training for Adobe enterprise technologies. Formerly of Allaire and Macromedia, Robin is an Adobe Certified Master Instructor for Flex and ColdFusion, an Adobe Ambassador and Regional Co-ordinator for Adobe User Groups in Australia and New Zealand. He has a BSc in Computer Science and Pure Mathematics and is based in Sydney, Australia.

Are We on the Same Page?

Some hopefully self-evident thoughts about software design.

What is Architecture

Model View Controller

Separation of Concerns = Freedom to Solve

Dependency Injection

Two Hats: Tool Maker & Integrator

Frameworks: Perimeter Fence or Escape Plan?

How to use Cairngorm

It's a Light Switch, not a Power Plant

Getting in Touch With Your Inner Application

Many Ways to Model

When to use Commands

When Do I Need a New Event Class

What is a Service

How not to use Cairngom

Why People Get Upset with Cairngorm

Business Logic in Value Objects?

Business Logic - It's Not the Model

Business Logic - It's Not the Controller

Comparing Cairngorm with Other Flex Frameworks

Comparing Cairngorm with CairngormX

Comparing Cairngorm with Mate

Comparing Cairngorm with Pure MVC

The Rest of Your Application

When to use MXML

We Heart Binding

State Machines in Commands

Resources, Style Sheets and Code Tables

Dangers of Flex Development

Control Expectations

Loosing Your Model

Useful References