Accessibility

Table of Contents

Developing Flex RIAs with Cairngorm microarchitecture – Part 4: Feature-driven development

Service to Worker: mapping user gestures and system occurrences to events

The user accesses the vast majority of features through user gestures. Gestures are made through the mouse or keyboard, for example, by clicking a button, double-clicking an entry in a data grid, dragging and dropping an object, or submitting a form.

Consider the Cairngorm Store features listed previously. All of them except the requirement to get products from the database occur in response to a user gesture. Here are some examples of user gestures:

  • User sorts products by clicking a button
  • User drags a slider component to filter products
  • User adds products to the shopping cart by clicking an Add to Cart button or by dragging and dropping an image into the shopping cart

More often than not, you map the execution of a feature to a user gesture.

If you come from a web application development world, you will likely see each feature as requiring an HTTP request to the server, with the server doing some of the work on your behalf and returning data to the client, most often with a browser refresh.

With an RIA, a feature is not always instigated by a user gesture; for example, the fetching of the products from the database is done immediately when the application starts. Rather than resulting from a user gesture, getting the products from the database is an event that happens within the system. Other such system-level events might include a feature that executes periodically, such as fetching e-mail messages every 30 seconds.

The single biggest innovation in Cairngorm is that the Cairngorm framework treats user gestures and system-level events the same way by mapping them to a Cairngorm event. Breaking free of the request/response paradigm of HTML-based technologies, user requests are no longer synonymous with HTTP requests. Instead, user requests are internal events that components can broadcast when they recognize a user gesture or system event.