Accessibility

Flex Article

 

Developing Flex RIAs with Cairngorm microarchitecture – Part 1: Introducing Cairngorm


Table of Contents

Comments

What Cairngorm Teaches You

The Cairngorm microarchitecture addresses three key areas that Adobe Consulting has long recommended as best-practices for our customers and partners:

  • Handling user gestures on the client
  • Encapsulating business logic and server interactions
  • Managing state on the client and representing this state to the user interface

Cairngorm offers a microarchitecture (collection of design patterns) to help consistently solve these recurring design challenges.

As you read this series of articles, you’ll gain a deeper understanding of how design patterns are applied in the development of RIAs, including:

  • How the Front Controller and Command patterns implement a "Service to Worker" microarchitecture for listening and responding to user requests.
  • How the Business Delegate and Service Locator patterns interact so that you can reuse and encapsulate business logic and establish a clear contract between client and server-side development teams, independent of server-side technical implementations such as LiveCycle Data Services, web services, Enterprise JavaBeans, ColdFusion components, or even RESTful architectures using XML over HTTP.
  • How the Value Object pattern from J2EE can collaborate with the Model Locator pattern to enable an elegant strategy for maintaining a stateful client with a rich and cinematic user experience.

The current state of Cairngorm

Cairngorm, currently at version 2.2, has constantly evolved alongside Flex. Today, Cairngorm has a broad user base that has successfully used the framework in their development efforts. The Cairngorm Committee has also grown; it is now comprised of a committed core of Adobe consultants and engineers, as well as numerous community members.

The core Cairngorm concepts remain the same. Only the underlying implementation has changed to keep pace with additional thought leadership and best practices on how to leverage the features within the latest version of Flex, such as LiveCycle Data Services including Flex RPC Services. Be sure Cairngorm will track the latest release of Flex.

Note: In the final article of this series, we explore the criteria you can consider as you decide when to use Cairngorm—and when not to use it. We do not mean to suggest that Cairngorm is the only way to build rich Internet applications. Nor do we even suggest that the best practices we present are the only best practices. In fact, others may promote best practices that seem to contradict what Cairngorm suggests.

We do, however, recommend that you first try to understand the problems that Cairngorm is intended to solve before attempting to solve them with Cairngorm. If you are just learning Flex as you build one of your first rich Internet applications, we strongly suggest that you become comfortable with the many new tools and techniques that the technology and platform offer you before complicating your learning curve with Cairngorm.

This is not to say that Cairngorm is complex. On the contrary, it is important that you be confident and comfortable building simple RIAs that do not require the benefits of a technical architecture such as Cairngorm before taking advantage of the benefits that Cairngorm offers.

Parts 2 through 6 will ensure that seasoned and novice Flex developers alike understand the RIA challenges that created the problems that Cairngorm solves. This series is intended to explain as clearly as possible—using detailed code-level examples—the elegant way in which Cairngorm can help you solve them.

Where to Go from Here

As Part 1 of a six-part series, this article introduced the Cairngorm framework by clarifying the ambiguity around the definition and usage of frameworks, explaining why you might use a framework, and providing an overview of the origins and the future of the Cairngorm framework.

With Flex, you can build your own, more complex, application-specific architectures using the suggested implementation of a technical architecture that the Cairngorm architectural framework provides. By basing your application on the Cairngorm architecture there are some generic and fundamental design challenges that you won't have to solve by yourself, such as how to handle user gestures in an elegant fashion, how to handle server interaction and business logic in an elegant and scalable fashion, and how best to manage state on a rich and immersive client application.

As we noted earlier, iteration::two borrowed software design patterns that were useful to us as J2EE developers, and re-applied them in RIA development. Having an aerial view of the technical architecture often helps developers identify recurring collaborations of design patterns. The realization that such collaborations, known as microarchitectures, exist is the foundation of the Cairngorm framework.

When consulting, we often say that the difference between theory and practice is that, in theory, there's no difference between theory and practice. In Part 2, we move past the discussion of context and background of design patterns and microarchitecture, and present the four key benefits that Cairngorm provides:

  • Maintaining state on the client
  • Architecting the user experience
  • Implementing feature-driven development
  • Invoking server-side services

In Part 2, you'll get a hands-on feel for how to leverage the Cairngorm framework in application development, the problems that Cairngorm solves, and the ease with which you can consistently deliver highly scalable, maintainable, and robust rich Internet applications with Flex.

Developing Flex RIAs with Cairngorm microarchitecture – Part 2: Keeping State on the Client