Book Review: Ajax for Web Application Developers - Ajax Patterns
(Page 3 of 4 )
If the section on creating and using the Ajax Engine was my favorite, then the section on Ajax Patterns was where Kris Hadlock put in a lot of his energies. It is clear from the writing that creating highly interactive/usable forms is important to him. This section contains chapters on design patterns, with special attention to the Singleton Pattern (which he used in creating his data handling object). A singleton pattern has a single instance. Other patterns he explained, using logic and relatively simple objects, included the model view controller, the observer pattern, the data reflection pattern, interaction patterns and usability patterns; do take note of the chapter on usability patterns.
The singleton pattern uses one single instance to handle all your AJAX objects. In the particular illustration used, Hadlock created an object to handle all requests in the sample program. The model view controller pattern works at separating the front end (GUI) from the back end (programming back bone) with a controller in between that allows back end programmer to develop applications separate from the GUI. There is a rigorous focus on methodology and underlying logic throughout this section.
He explained the interaction pattern, using a cookie setting JavaScript object; if I wanted to be more technical I would call it a "session handling" object. He also explained the interaction pattern and how it can create very good looking AJAX features such as drag and drop functionality by using CSS to create the box and JavaScript to control the application.
However it is in the "Usability Patterns" chapter that Hadlock excels himself, using a model that gives feedback, errors and warnings to the client. He created forms that give feedback using color codes and intuitive error messages, without taking the user off the page. In brief he shows how to create error messages and feedback using code creatively; as an example, consider how blogspot gives error messages when you use a URL that is already in use. He gives clear reasons why users will be able to react better to subtle changes in the interface (which still gives information with clarity). He also gives all the code and I have to be honest, I expect to use this particular set of code repeatedly (though I still prefer the debugging chapter). The major advantage apart from the user experience is ease in debugging when working on large team-involved programs.
Understanding AJAX Server Side Interaction
In this segment he explains how to "create user experiences unique to AJAX" and how to connect to the server from the client side using PHP. As I said earlier a knowledge of PHP/MySQL is assumed, but other languages can be used. ColdFusion and ASP specifically were used as illustrations of other languages which can interact with the database effectively, however he uses PHP because it is open source and easy to learn (I agree totally).
Finishing Touches
The last subjects he touched were the issues of security and updating, and how to effectively use the object. We have gone through the book at light speed; there are some things I would like to mention about the book before I give it my "grade," which should be obvious by now.
Next: My Thoughts >>
More JavaScript Articles
More By Akinola Akintomide