Thursday March 11 , 2010

Pinball Wizard Framework

Pinball is free software that allows developers using Adobe's Flex and AIR platforms to quickly and easily create custom Wizard applications.

The Wizard is one of the most ubiquitous software concepts, and one that most users are instantly comfortable with. Employing simple navigation, a Wizard guides the user through some multi-step process. They can be particularly effective when the user may take several possible paths through a branching process structure.

Over the web, a Wizard could simply be a handy way to break a long and tedious form into logical sections. It could configure a product for purchase; control an online checkout process; conduct a survey; present a portfolio of work; guide troubleshooting efforts, etc. The possibilities are literally endless.

To implement a Wizard using Pinball, you will need:

  • Some rudimentary Flex and Actionscript 3 skills; you should understand CSS styling, data binding, event dispatching and handling, and how to create custom components.
  • The Flex SDK and either use Adobe Flex Builder or the command line compiler that comes with the SDK to compile your final swf file.
  • The Pinball Framework API, a very small .swc library.

Key Concepts

The PagesFor each step of the Wizard, a Page is used to display or collect information. It can interact with the framework, for instance marking the current step complete once required fields are supplied and validated, causes the framework to enable the Next button (or Finish if this is the last step). If the user should remove required data from a completed step, then the wizard page can mark the step incomplete, causing the Next (or Finish) button to become disabled again.
The OverviewThe position and completeness of each step is reflected in the Overview, which contains buttons for each step. Completed steps can be revisited by clicking their corresponding buttons in the Overview. Incomplete steps can be seen, but do not respond to interaction in the Overview.
The ModelNo matter how simple your Wizard may be, it will need a Model; a common object to manage the data that the Pages of the Wizard work with. You supply a value object that will be made available to all Wizard Pages.
The Finish ButtonThe user navigates through the pages of your Wizard with some goal. in mind: making a purchase, submitting feedback or a survey, etc.. The culmination of the process is occurs with the click of the Finish button when the last page is filled. In Pinball, the Finish action is an HTTP request, either GET or POST, using the data collected. The REST style interface was chosen because it is compatible with many existing services. This will allow you to easily 'fold' a long HTML form into a logically divided Wizard process that submits to the existing service, often without modification.

Inversion of Control

Because it is meant to get as many people up and running as quickly as possible, the Pinball framework is focused on creating standalone Wizard applications and does not currently support adding a Wizard as a component to an existing application.

Another reason Pinball is not a drop-in component is that, architecturally speaking, it is based on the Inversion Of Control (IOC) design pattern.

In a normal application, the developer supplies the code that controls the structure and flow of the application. Frameworks used by such an application typically provide only components that are instantiated and used by it.

With IOC, the developer supplies only components and configuration, relinquishing the control structure (and happily, the related effort to implement it) to the framework. Thus, control is said to be 'inverted'.

Anatomy of a Wizard

Every day we see Wizards for performing all sorts of tasks. To reduce confusion (and tech support questions) the interface presented to the user is necessarily kept simple. It is this simplicity that puts us at ease with using Wizards. While there are many visual designs for them, there is a common set of elements and behaviors that are almost always present:

  • HeaderA horizontal banner usually found across the top that remains constant, holding branding elements as well as wording that indicates the Wizard's purpose.
  • NavA horizontal bar usually found at the bottom of the Wizard, containing Previous, Next, Finish, Cancel, and Help buttons. At different times any of these buttons may be displayed or disabled, but their spatial layout is simple and helps the user move quickly though the process.
  • StepsA vertical Overview bar containing buttons or labels showing the steps of the process and the user's progress so far. The buttons allow the user to return directly to a previously completed step as well as letting them see the steps yet to be completed.
  • Pages A Content area usually displayed to the right of the Steps Overview, above the Navigation Bar and below the Header Area, displays the Pages for each step of the process. Pages  may be informational only or they may collect data from the user.

There may be alternate and mutually-exclusive 'States' to a Wizard. Most of the user interface elements are present when the Wizard is in what we might term the 'Form' state, where it is presenting or collecting information. Common 'States' found in most Wizards are:


  • FormUsed for presenting or collecting information, usually the Navigation, Steps Overview, and Content areas are present.

  • WaitDisplayed while the Wizard is communicating with a database, or remote service, working at length with the filesystem, or is compute-bound for more than a few seconds. The navigational elements, not relevant during this time, are typically replaced by an image, a  message, a progress bar, and a Cancel button.

  • ErrorUsed to communicate an Error to the user, and their options at this juncture. Replacing the navigatonal controls, at minimum we usually see a message and a Cancel button if the user is allowed to return to the Form state and try again.

  • DoneDisplayed when the function of the Wizard is complete. Generally displays a message about the success of the submission, and perhaps one or more links to logical next destinations.



In creating Pinball, several assumptions about the nature of and scope of Wizards had to be made in order to arrive at something that would be recognizable and familiar to users while supporting a large number of the tasks businesses often want a Wizard to perform.

The framework does all the 'heavy lifting' of controlling the users navigation through the pages, submitting the data, handling service success or fault. To create a Pinball Wizard, you need to supply:


  • DesignA CSS stylesheet controls the look of nearly aspect of the Wizard's appearance. Also, you add any images to be used throughout the Wizard.

  • ConfigCreate an instance of a framework configuration class and populate it with the values that will control more aspects of the Wizard's look and feel.

  • PagesCreate subclasses of a framework class that represent each step of your Wizard process.

  • ModelA single class that is used to collect the data for the Wizard. It is shared by all the pages, which typically populate it with the information they gather.

  • ServiceA  web based Wizard typically has the goal of collecting information to be submitted to a remote service.

CSS Styling

Most of the look and feel of your Wizard is managed with a CSS style sheet.

Custom Pages

You provide your own custom wizard pages; one for each step of the Wizard. You also supply a data model value object which is shared by all the pages.

Simple Config

Those aspects not controlled in the style sheet are handled in a simple configuration value object.

Coming in Q1

Pinball was battle-tested in 2007 with two Wizards used by over 600 courseware beta testers to sign up and subsequently report detailed feedback about each chapter of the material as they progressed.

Pinball - coming soon

Pinball is currently being tidied up a bit and a demo is being created. For now, you can see a functional example when you...