Advanced Ajax: Architecture and Best Practices and over one million other books are available for Amazon Kindle. Learn more


or
Sign in to turn on 1-Click ordering.
or
Amazon Prime Free Trial required. Sign up when you check out. Learn More
More Buying Choices
Have one to sell? Sell yours here
Advanced Ajax: Architecture and Best Practices
 
 
Start reading Advanced Ajax: Architecture and Best Practices on your Kindle in under a minute.

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

Advanced Ajax: Architecture and Best Practices [Paperback]

Shawn M. Lauriat (Author)
4.3 out of 5 stars  See all reviews (3 customer reviews)

List Price: $44.99
Price: $31.02 & this item ships for FREE with Super Saver Shipping. Details
You Save: $13.97 (31%)
  Special Offers Available
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
In Stock.
Ships from and sold by Amazon.com. Gift-wrap available.
Only 1 left in stock--order soon (more on the way).
Want it delivered Thursday, February 2? Choose One-Day Shipping at checkout. Details
Textbook Student FREE Two-Day Shipping for students on millions of items. Learn more

Formats

Amazon Price New from Used from
Kindle Edition $16.20  
Paperback $31.02  

Book Description

0131350641 978-0131350649 October 25, 2007 1

“I very much enjoyed how this book covers the full Ajax application lifecycle and not only coding techniques. Anyone who is looking to become a professional front-end developer will appreciate the architectural insight and best practices delivered by this book.”  — Andi Gutmans, Co-Founder & Co-Chief Technology Officer of Zend Technologies

 

Mission-Critical Ajax: Maximizing Scalability, Performance, Security, Reliability, and Maintainability

 

Advanced Ajax: Architecture and Best Practices is the definitive guide to building business-critical, production-quality Web applications with Ajax. Shawn M. Lauriat systematically addresses the design, architecture, and development issues associated with Ajax, offering proven patterns and robust code examples available in no other book. You’ll find best practices for addressing the full spectrum of issues enterprise Ajax developers face: scalability, performance, security, reliability, flexibility, maintainability, and reusability.

 

Writing for experienced Web developers, Lauriat delivers fresh ideas and elegant solutions: meaty technical content, presented with exceptional clarity. Among the many topics he covers in unprecedented depth: cleanly implementing JavaScript custom events to reduce coupling and to enhance flexibility; overcoming Ajax’s traditional accessibility limitations; reducing network latency through compression and other techniques; and much more. Coverage includes 

  • Planning Ajax interfaces for simplicity, clarity, and intuitiveness
  • Creating scalable, maintainable architectures for client-side JavaScript
  • Using the latest tools to profile, validate, and debug client-side code
  • Architecting the server side for security and functionality, while restricting loaded data, objects, and actions to current requests
  • Protecting against the most widespread and significant Ajax security risks
  • Optimizing every component of an Ajax application, from server-side scripts to database interactions
  • Introducing cutting-edge Ajax: game development, Ajax with canvas, and Ajax for enterprise applications

About the Web Site

This book’s companion Web site (http://advancedajax.frozen-o.com) doesn’t just provide all the code: It shows code examples in action, as building blocks of a real Web application interface.


Special Offers and Product Promotions

  • Buy $50 in qualifying physical textbooks, get $5 in Amazon MP3 Credit. Here's how (restrictions apply)

Frequently Bought Together

Customers buy this book with JavaScript: The Definitive Guide: Activate Your Web Pages (Definitive Guides) $31.49

Advanced Ajax: Architecture and Best Practices + JavaScript: The Definitive Guide: Activate Your Web Pages (Definitive Guides)

Customers Who Bought This Item Also Bought


Editorial Reviews

About the Author

Shawn M. Lauriat is owner and lead developer of Frozen O Productions. He recently joined IBM as a senior PHP engineer for IBM Rational BuildForge when his employer, BuildForge, was acquired by IBM. Lauriat is a Zend Certified Engineer.

Excerpt. © Reprinted by permission. All rights reserved.

Introduction

Introduction

As the centerpiece of rich web application development, Ajax brings web interfaces using XHTML and CSS up to desktop application interface standards without the interfaces having to rely on plugins such as Flash or Java. Prior to JavaScript-based server interactions, interfaces had to rely solely on full-page loading, regardless of how one might have hacked a page into appearing otherwise.

Until Ajax development came along (which, incidentally, started in implementation many years before the coining of the term itself), client-side development also had no thread support. Threading, in a nutshell, allows the spawning of new lines of logic, completely independent of those before, adjacent to, or after it. C, Java, Perl, and many other languages have had this support for many years (in some cases) before client-side scripting came along in any fashionable sense. The closest JavaScript had to offer came in the form of the setTimeout and setInterval library functions, which required delayed, seemingly parallel execution rather than the actual spawning of processes. While Ajax still does not provide true threading, it does bring JavaScript one step closer.

0.1 Ajax, the Acronym

The words Asynchronous Javascript And XML make the acronym Ajax. In order to fully understand Ajax in meaning and implementation, you must understand each of its components. Even when using synchronous requests, or using JSON or some other transportation method, knowing the core aspects of Ajax can only help development practices.

Since the initial boom in popularity and resulting hype surrounding Ajax, it can get quite easy to forget what Ajax actually means and what it doesn't. Ajax does exist as an incredibly useful method of communicating with the server directly from JavaScript. It does not mean anything more than that, even if its usage can open up development methods previously unexplored in web application development.

0.1.1 Asynchronous

When requests get submitted to the server, they have no direct impact on any other simultaneous or subsequential requests. In other words, just because a request gets submitted before another request does not in any way ensure that it will receive its response from the server first. Despite the seemingly simplistic concept, asynchronistic behavior in applications often gets ignored, because asynchronicity introduces an entirely new level of complexity to client-side development.

Many Ajax-based web applications use the asynchronous flag of the XMLHttpRequest object solely to handle network errors (sometime without even intending to do so) rather than to keep functionality enabled during a given request. While the direct JavaScript-to-server communication provided by the XMLHttpRequest forms the core of the technology, the asynchronous behavior it also can provide often plays the part of the unsung hero, as it brings a wealth of flexibility and strength to client-side web applications.

0.1.2 JavaScript

JavaScript (based on ECMAScript,1 though possibly vice-versa depending on whom you ask) has many implementations, not only in various web browsers, but also in game development and other applications needing an easy-to-learn scripting language. This book focuses on the implementation of JavaScript in various web browsers. These implementations of JavaScript have a wide variety of incompatibilities, from Mozilla's SpiderMonkey2 to Safari's WebKit to Jscript and more.


1Ecma International, an industry association devoted to standardizing "Information and Communication Technology (ICT) and Consumer Electronics (CE)" (What is Ecma International, http://www.ecma-international.org/memento/index.html), maintains the ECMA-262 standard (http://www.ecma-international.org/publications/standards/Ecma-262.htm) which defines the scripting language of ECMAScript.
2http://developer.mozilla.org/en/docs/SpiderMonkey—The Gecko rendering engine's JavaScript engine written in C is used by Mozilla-based browsers such as Firefox (http://www.mozilla.com/products/firefox), SeaMonkey (http://www.mozilla.org/projects/seamonkey), Camino (http://www.caminobrowser.org), and Epiphany (http://www.gnome.org/projects/epiphany).


Those used to server-side development or OOP (Object-Oriented Programming) may initially get thrown off by JavaScript's prototype-based object model. This, in a very basic sense, means that functions and methods called within a certain object get called in the context of that object. This happens because rather than an instance having an explicit tie to its definition, its prototype merely lays out the basis for its structure and characteristics.

The JavaScript object, XMLHttpRequest (originally an ActiveX control created by Microsoft), provides the key to the entire technology conglomeration now referred to as Ajax. It provides an interface by which JavaScript can send and receive data to and from the server without requiring a full page load. Other methods exist for sending and receiving data, but they each use aspects of HTML and XHTML in ways other than designed, and, as such (while still useful in certain circumstances), they exist only as hacks.

0.1.3 XML

XML stands for eXtensible Markup Language, as defined by the World Wide Web Consortium (W3C; http://w3.org), and provides a very flexible, generic text format. If that seems to be a rather broad description, it should be .XML now uses spanning data storage, communication, definition, description, and presentation. In Ajax, XML refers to data transportation. The XMLHttpRequest object provides another useful bit of functionality along with its HTTP methods: When the server returns XML, the XMLHttpRequest object provides the responseXML attribute, which is a read-only XML document of the response.

Using XML, a very simple response from the server, with two named variables (var1 and var2) each set to string values ("first value" and "second value," respectively), might look like the following:

  first value  second value

Many Ajax-driven web applications use other formats of transporting data to and from the server, including:

  • URL-encoded—Where data takes the form used by HTTP POST requests, as during a form submission such as var1=first%20value&var2=second%20value.
  • Raw text—Usually for very simple data, or when responses return the exact markup for the JavaScript to insert into the current document:

            
  • JavaScript Object Notation (JSON)—An increasingly popular format, JSON formats data into a subset of raw JavaScript. This not only has the advantage of instant parsing by client-side code, but also it tends to take up less bandwidth than more verbose, globally understood formats such as XML. In addition, it does so without losing the data structure as URL-encoded value pairs do:

        {        var1:"first value",        var2:"second value"    }

0.2 This Book's Intentions

Now that the technology has progressed into general usage, the Ajax developer community has a need for books covering architecture, tuning, alternative uses of Ajax, and more. Many books and tutorials have provided good introductions, and they can show you several different ways of implementing find-as-you-type, chat widgets, and RSS/ATOM feed readers. Many of the resources out there explain, in great detail, the history of Ajax and its multiple incarnations before today's and the implementation centered on the XMLHttpRequest JavaScript object. See Appendix A, "Resources," at the end of this book for some choice suggestions.

This book, instead, looks at using Ajax to create rich, browser-based interfaces for enterprise-level web applications, taking into account the flexibility, reusability, scalability, and maintainability necessary for such an undertaking. Ajax does not exist in this book as the latest and greatest acronym to hit web development. It instead exists as a tool like any other—extremely useful in some instances and totally wrong in others.

For example, many reference sites would find themselves hard-pressed to use Ajax for anything of particular value to their users. Manuals and other reference materials that have large blocks of text for the user to read might come up with an Ajax reader, allowing a single, scrollable pane that late-loads content as the user scrolls though it. This sounds cool, but it destroys the ability to search the page for a particular word or phrase. It also removes the ability to read something once you've lost your Internet connection. Some reference sites add auto-suggestions to their search fields, but those tend to react too slowly for general usage unless you pre-load the entire dictionary into the browser's memory, potentially wasting a great deal of bandwidth for a feature that only a few people mi...


Product Details

  • Paperback: 384 pages
  • Publisher: Prentice Hall; 1 edition (October 25, 2007)
  • Language: English
  • ISBN-10: 0131350641
  • ISBN-13: 978-0131350649
  • Product Dimensions: 9.2 x 7.1 x 0.9 inches
  • Shipping Weight: 1.6 pounds (View shipping rates and policies)
  • Average Customer Review: 4.3 out of 5 stars  See all reviews (3 customer reviews)
  • Amazon Best Sellers Rank: #1,373,389 in Books (See Top 100 in Books)

More About the Author

Discover books, learn about writers, read author blogs, and more.

 

Customer Reviews

3 Reviews
5 star:
 (2)
4 star:    (0)
3 star:
 (1)
2 star:    (0)
1 star:    (0)
 
 
 
 
 
Average Customer Review
4.3 out of 5 stars (3 customer reviews)
 
 
 
 
Share your thoughts with other customers:
Most Helpful Customer Reviews

8 of 9 people found the following review helpful:
3.0 out of 5 stars "advanced ajax for PHP developers", January 6, 2008
By 
This review is from: Advanced Ajax: Architecture and Best Practices (Paperback)
"Advanced AJAX" is targeted towards AJAX application architects. Note that readers should be comfortable learning by reading code. For example, chapter 1 has two pages of code for a GUI widget. This seems heavy for a conceptual book. Elsewhere, the main idea got lost in six pages of view code.

I liked the non-technology specific sections. Browser tools included Safari and Opera plugins. All the "hot" security topics were covered (SQL injection, XSS, CSRF.) Tradeoffs were listed for different alternatives. Performance included CPU, memory and bandwidth. Trying out examples on the companion website was nice.

Many server side techniques were PHP specific, such as SQL injection. While six pages of code is good for PHP developers, I was surprised. The code was readable without being fluent in PHP, but unnecessarily narrows the audience. The 15 pages of screenshots/description on the PHP documentation tool could have been used for another topic. Wouldn't a PHP developer already know how to use PHP?

While I liked the presence of an accessibility chapter, I found it confusing. WCAG and Section 508 were introduced clearly early in the chapter. For the rest of the chapter, I wasn't clear on what pertained to WCAG, what was 508 complaint and what was coming in the future.

If you are a hands on PHP AJAX developer interested in architecture, this is an excellent book. Non-PHP developers or people who want to focus on architecture (rather than code) are better off with a different book.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


7 of 8 people found the following review helpful:
5.0 out of 5 stars Incredibly useful--worth reading a couple times through, December 11, 2007
This review is from: Advanced Ajax: Architecture and Best Practices (Paperback)
This book is a rarity--a sort of architectural cookbook. The author takes a very careful, calculated approach to a topic that has become a buzzword--lending itself to gross overuse just for the sake of doing so.

The running thoughts throughout this book are to keep AJAX design unobtrusive, accessible (has a very good Section 508 introduction), segmented/modular, and easily maintainable. It even has a single chapter dedicated to security that was more useful than an entire book I read on the subject.

I highly recommend this for any developer working with JavaScript, AJAX, or Silverlight. Even with its PHP/MySQL flavor, the philosophies and practices the author shares are applicable to any platform, and they are dead on--simply the right way to design and implement AJAX solutions.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


0 of 4 people found the following review helpful:
5.0 out of 5 stars A vast range of customization resources., February 6, 2008
This review is from: Advanced Ajax: Architecture and Best Practices (Paperback)
College-level and advanced computer holdings catering to Ajax developers and web programmers will find here an excellent guide to building business-quality web sites, covering the design and development issues associated with Ajax and offering patterns and code examples unavailable elsewhere. From planning Ajax interfaces for clear and smooth functions to using the best tools to debug code and achieve maximum security, ADVANCED AJAX covers many topics beginning books won't, and provides web programmers with a vast range of customization resources.

Diane C. Donovan
California Bookwatch
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No

Share your thoughts with other customers: Create your own review
 
 
 
Only search this product's reviews



Inside This Book (learn more)
Key Phrases - Statistically Improbable Phrases (SIPs): (learn more)
game development, unit testing, rich interfaces, command window, memcache extension, var dis, php foreach, last list item, template engine, post text, registration interface, semantic markup, event dispatching, class documentation, abstraction class, screen readers, hit test, user scripts, event listeners, browser extensions, factory pattern
Key Phrases - Capitalized Phrases (CAPs): (learn more)
Model-View-Controller Design Pattern, Client-Side Application Architecture, Performance Optimization, Debugging Client-Side Code, Server-Side Application Architecture, Web Application Secure, Maintainable Ajax, Next Step, Using the Factory Pattern, Internal Developer Documentation, Internet Explorer, Different Kind of Security, General Practices, Multitude of Simple Interfaces, Another Item, Fire Vox, Single Player, Markup Validator, Screen Readers Can Handle Ajax, Confirm Password, Don't Trust the Server, Interface Versus Showcase, Intel Mac, Space War, United States
Browse Sample Pages:
Front Cover | Table of Contents | First Pages | Index | Back Cover | Surprise Me!
Search Inside This Book:

What Other Items Do Customers Buy After Viewing This Item?


Tags Customers Associate with This Product

 (What's this?)
Click on a tag to find related items, discussions, and people.
 
(5)
(2)

Your tags: Add your first tag
 

Customer Discussions

This product's forum
Discussion Replies Latest Post
No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
Topic:
First post:
Prompts for sign-in
 


Active discussions in related forums
Search Customer Discussions
Search all Amazon discussions
   
Related forums



So You'd Like to...


Create a guide


Look for Similar Items by Category


Look for Similar Items by Subject