Saturday, December 23, 2006

RCP Patterns and Anti-Patterns

Here are some Eclipse RCP Patterns and Anti-Patterns that Kevin Taylor and I distilled from our Eclipse RCP experience and the experiences of other developers who worked with us.

RCP Pattern Summaries:

Is The Job Done Yet?
To avoid application freezing when performing long-running tasks, use The Jobs API to improve usability

Summaries Are For Viewing; Details Are For Editing
Manage complexity and simplify application usage by utilizing Views to display data summaries and Editors to allow editing of data.

Serve Me A UI Screen Please
Enable Plugins to share UI screens (e.g. dialogs, wizards, panes) via a UI Screen broker Plugin.

One Plugin Per Library
Put each 3rd party library in its own Plugin. this prevents having to download the library during application updates every time its client Plugins are downloaded.

Compose Widget
When two or more screens have a similar cohesive subset of child widgets (e.g. address fields), extract those child widgets into an aggregate reusable widget to avoid repetition.

Instant Bean Brew
Instead of requiring users to hit save to persist data changes, improve UI efficiency by implementing the instant-persistence-paradigm using the JFace DataBinding framework.

RCP Anti-Pattern Summaries:

Everything But The Kitchen Sink
Placing all classes in a single Plugin can significantly increase download size during application updates. This also makes it harder to offer an application with configurable features.

Edit The Universe
Using a single editor to edit all data models (or a big number of them) causes information overload and makes it hard to discern structure or workflow.

The Obese Wizard
Placing too many controls on one page in a Wizard can impact usability negatively. Instead, break controls into multiple pages according to a logical flow.

Are Those Really Family?
Wizards, Editors, or Views that are in the same category, but do not follow consistent UI standards (e.g. margins, widget sizes, or colors), can hurt the professional look of the application and slow down the user from learning it.

But How Do I Fix It?
Your application is validating user input on "save" or on some other life-cycle event. When the validation finally occurs, the user has no idea how to fix it. Provide validation errors as soon as possible, preferably on loss of focus or character press. If that is not possible, have a way to help users navigate to the problem. If that is not possible, give users enough information so they can solve the problem.