AJAX Design Patterns
Wednesday, August 6th, 2008What is AJAX? AJAX is a remote scripting technique that allows the browser to call the server without posting the entire page back to the server. This allows the browser to retrieve little chunks of data and dynamically update areas on the page. The result is a greatly enhanced user experience and highly responsive Web 2.0 applications.
AJAX Design Patterns provide solutions to recurring problems when building AJAX-style web applications. To give you a headstart with using AJAX Patterns in your own work we provide you with several valuable examples. Each pattern comes with a definition, an overview, and a live example. They are built with Microsoft AJAX and ASP.NET 2.0 AJAX. Source code is available.
AJAX Abstraction Patterns
· AJAX Level I level 1: raw Javascript
· AJAX Level II level 2: Microsoft AJAX client library
· AJAX Level III level 3: ASP.NET 2.0 AJAX server controls
AJAX Level I: Definition
Write AJAX applications in raw JavaScript using HttpRequest and related technologies. No pre-written libraries or frameworks are used.
AJAX Level II: Definition
Add AJAX functionality to a website using an AJAX library (Ajax.Net, Prototype, Microsoft AJAX, etc). This usually involves programming Javascript but at a higher abstraction level resulting in fewer lines of code than without a library.
AJAX Level III: Definition
Add AJAX functionality using highly abstracted, server-side technologies, such as ASP.NET 2.0 AJAX Extensions. This makes developing rich and highly interactive AJAX-style applications very easy. Little or no Javascript is required.
AJAX Message Patterns
- Text Message – message contains plain text
- HTML Message – message contains HTML
- XML Message – message contains XML
- XSL Message – message contains XSL
- JavaScript Message – message contains Javascript
- JSON Message – message contains JSON formatted data
- Custom Message – message contains custom formatted data
Text Message: Definition
Messages between browser and server are formatted as simple text strings.
HTML Message: Definition
Messages between browser and server contain HTML fragments.
XML Message: Definition
Messages between browser and server contain XML formatted data.
XSL Message: Definition
Messages between browser and server contain XSL.
JavaScript Msg: Definition
Messages from the server to the client contain Javascript. The Javascript is dynamically executed by the browser.
JSON Message: Definition
Messages between browser and server contain JSON formatted data.
Custom Message: Definition
Messages between browser and server contain custom formatted data