Smuttygirl.info - Ajax Patterns

Smuttygirl.info

From Ajax Patterns

Revision as of 13:35, 15 June 2005; view current revision
←Older revision | Newer revision→

We are uncovering new ways to weave the world wide web.

Ajax In General: Whats AJAX? | AJAXPrinciples | AJAXFrameworks

Ajax Patterns:' Why AJAX Patterns? | BrainDump | Incoming | Credits

Subscribe to Feeds: orangerss.gif New Pages (Recommended)     orangerss.gif Recent Changes (Noisy)

Contents

Ajax/Javascript Programming and Usability in "Ajax Design Patterns" Book

Background

AjaxPatterns.org is an in-progress collection of AJAX patterns being collected and discovered by Michael Mahemoff, building on an initial draft published on my blog about a month ago. Contributions and comments are very welcome. For the next few weeks, the main pages are read-only as I am aiming to keep the language structure as cohesive as possible. Meanwhile, you can now edit the Discussion area and I'm watching the RSS feed closely, so any comments will be incorporated into the main pages ASAP. What's here is CC-licensed, so please feel free to pull any content into your own work.

News:

  • June 15, 2005 - Added about 20 new patterns and completely restructured the pattern language.
  • June 13, 2005 - Reinstalled the wiki today to fix editing and broken links on special pages. Ongoing, the pattern URLs will be neat, ie ajaxpatterns.org/PatternName.

Foundational Technology Patterns

These patterns cover the basic building blocks of Ajax applications. They are more "reference patterns" than true "design patterns" as they are intended to introduce the types of technologies that are used, provide a common vocabulary used throughout, and facilitate a discussion of pros and cons.

Changing Browser Content with the DOM

  • Display Morphing Alter styles and values in the DOM to change display information such as replacing text and altering background colour.
  • Control Redefinition Alter event handlers in the DOM to redefine what happens when certain events occur.
  • Page Rearrangement Restructure the DOM to change the page's structure - moving, adding, and removing elements.

Remote Scripting

Not presently included because of portability concerns: Live Scripting, Java Applets.

Events and Scheduling

Programming Patterns

Browser-Server Dialogue

  • Modeless Dialogue Use asynchronous calls and a parallel interaction style to ensure the user can continue working while server calls are in progress.
  • RESTful Services Expose server-side information using RESTful services.
  • Heartbeat Establish a heartbeat protocol to ensure the browser and the server are aware of each other's activation status.
  • Middleware Messaging Adaptors Combine a Javascript adaptor with an HTTP adaptor to hook into a middleware messaging framework. (e.g. ActiveMQ Ajax Support.)
  • No-Cache Directives When server responses to the same query are volatile (the request is not idempotent), they should direct the browser against caching.
  • Generic Services Where several client applications access the server, make the server independent of application logic by exposing generic (non-application-specific) services on the server.
  • Specialised Services Where only one client application access the server, consider offering application-specific operations.
  • HTML-Generating Services Where complex DOM updates are required, have the server-side generate the required HTML.
  • Cross-Domain Mediator [Speculative] Allow the browser to communicate with other domains by server-based mediation.

Browser-Server Messages

Messaging between the browser and the server. In particular, what sort of messages will XMLHttpRequest receive?

XMLHttpRequest Scripting

UI Scripting

Server-Side Programming

Development and Deployment Practices

Functionality and Usability Patterns

Browser Widgets

All of these widget patterns will be familiar to end-users, having been available in desktop GUIs and some in non-AJAX DHTML too. They are included here to catalogue the interaction styles that are becoming common in AJAX applications and can benefit from XMLHttpRequest-driven interaction.

Widget Interaction Idioms

Performance Optimisation

Functionality

Transactions

  • Short Transaction Services Use short-lived transactions for any services which manipulate persistent data. Incorporating enabling and disabling of controls.
  • Optimistic Locking Services can incorporate optimistic locking validation,

and provide cues to help user decide if an upcoming transaction will be feasible.

  • Pessimistic Locking Services can incorporate pessimistic locking validation, providing visual cues about current locks, and using heartbeat techniques to control timeouts.

Display Patterns

  • Embedded Text Integrate text into graphics, and rely on Rich CSS to show text when fancy styling is desirable.
  • Age Display Indicate the age of any critical information. Vary background brightness, for instance.
  • Synchronisation Status Provide hints that indicate what's synchronised and what's pending.
  • Progress Indicator Hint that processing is occurring.
  • Multi-User Awareness Provide cues about presence and activities of other users.
  • Unique URLs Use a URL-based scheme or write distinct URLs whenever the input will cause a fresh new browser state, one that does not depend on previous interaction.

System Archetypes

A bit experimental. Maybe not patterns in the usual sense, but nonetheless useful because we can consider how the smaller patterns are weaved to form a particular type of system.


"AJAX patterns wiki - 100% buzzword compliant" -- RevGeorge