Chapter 9. Working with Robotlegs: Rich Examples

The applications we’ve built as examples are too large to describe fully in this book. Rather than build a shallow demo small enough to fill that role, we decided to pull out specific features from the example applications, running through the configuration, models, services, views, mediators and commands that come together to implement each feature.

To illustrate the balance of flexibility and consistency that Robotlegs can help you achieve, we’ve selected user stories common to many Flash and Flex applications:

  • Keeping the model aligned with user actions on a rich interface

  • Creating a new ‘something’

Feature implementation walk-through: Mosaic Tool

The Mosaic Tool is an example of an application where the model exists to represent the view, and not the other way around. In a twitter app, for example, the view exists to allow you to read and write the ‘messages’ which are the primary concern. Although most of the principles are common to both kinds of applications, a genuinely view-driven app creates a couple of specific challenges for the developer.

Challenge 1: Keeping things on a need-to-know basis

In our model, tile supplies are represented by VOs with three properties:

  • ID (a uint unique to each supply)

  • color

  • quantity

It’s necessary for each supply to have a unique ID because it’s valid for the user to set two supplies to the same color—particularly if they’re experimenting with how a pattern looks with different combinations of colored ...

Get ActionScript Developer's Guide to Robotlegs 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.