Скачиваний:
76
Добавлен:
02.05.2014
Размер:
28.89 Кб
Скачать

Manning: Ajax in Action

Home | Ordering Info | Shopping Cart | Manage My Account | Login Ajax in Action Inside the book Table of Contents Manning Blog Why small is sweet? Author Blogs Eric Pascarello more... Author Calendar 2005 Catalog Java .NET Perl XML All by Subject All by Title About... Manning Contact Us Covers Distributors ebooks Press Releases Manning Early Access Program (MEAP) Ordering Academia/Publicity User Group Program Jobs Manning Publications Co.

209 Bruce Park Avenue

Greenwich, CT 06830

      Ajax in Action

Dave Crane and Eric Pascarello

November 2005, 400 pages

ISBN: 1932394613

Softbound print book: $44.95

DESCRIPTIONHow to create the next generation of cutting-edge web interfaces.

Ajax exploded on the scene in the Spring of 2005 when a web site defined the term and Google released Google Maps and GMail, powerful examples of what Ajax can do. Ajax uses familiar web technologies - DHTML, CSS, DOM, and JavaScript - in radically different ways resulting in a much richer user experience. The key to success lies in knowing how to orchestrate them as a coherent whole, splitting off parts of what is normally done by the server and putting it into the browser for instantaneous response to user input. Ajax allows a new breed of web applications with the rich expressiveness of desktop applications.

This book helps developers realize that promise - it explains the big picture and how to unlearn many old coding habits. It explains the design patterns and best practices to create a live interface for the user, not get in his way. It also discusses important Ajax issues: how to make good use of network bandwidth, and how to identify, and avoid, common Ajax pitfalls. The book is aimed at all web developers with prior experience in web technologies, independent of the server technologies used. Examples of server code in the book are in Java and .NET.

The authors are Ajax developers with considerable depth of experience. They are bloggers and JavaRanch moderators.

ABOUT THE AUTHOR...Dave Crane holds degrees in Chemistry, Parallel Computing, and Ecological Economics from Edinburgh University in Scotland. He has worked with Internet technologies for the last ten years, primarily with Java technologies such as J2EE, Jini and Jython. He has pushed the boundaries of DHTML, and latterly Ajax, since 1997, in web site design, on early Digital TV set-top boxes and in home automation systems. Most recently, he has been senior developer for Smartstream Tchnologies Ltd., developing highly-interactive Ajax-based application frameworks that are currently in use in many tier-1 banks and financial institutions worldwide. Dave lives in Gloucestershire, UK.

Eric Pascarello graduated from Penn State University in 2002 with a B.S. in Mechanical Engineering. Since then Eric has been employed as a Senior Developer working with enterprise level applications in ASP.NET. Eric has also written "JavaScript: Your visual blueprint for dynamic Web pages (2nd ed)". Eric volunteers his free time as a moderator of the HTML and JavaScript forum at www.JavaRanch.com, a friendly online community dedicated to helping people learn Java and other web technologies. He lives in Laurel, MD.

Table of Contents Chapter 1: The four principles of Ajax: A new design for the Web 1.1 Why Ajax rich clients? 1.1.1 Comparing the user experiences

1.1.2 Network latency

1.1.3 Asynchronous interactions

1.1.4 Sovereign and transient usage patterns

1.1.5 Unlearning the Web

1.2 The four principles of Ajax 1.2.1 The browser hosts an application, not content

1.2.2 The server delivers data, not content

1.2.3 User interaction with the application can be fluid and continuous

1.2.4 This is real coding and requires discipline

1.3 Ajax rich clients in the real world 1.3.1 Surveying the field

1.3.2 Google Maps

1.4 Alternatives to Ajax 1.4.1 Macromedia Flash-based solutions

1.4.2 Java Web Start and related technologies

1.5 Summary 1.6 Resources Chapter 2: First Steps with Ajax 2.1 The key elements of Ajax 2.2 Orchestrating the user experience with JavaScript 2.3 Defining look and feel using Cascading Style Sheets 2.3.1 CSS selectors

2.3.2 CSS style properties

2.3.3 A simple CSS example

2.3.4 Using CSS for layout

2.3.5 Using CSS for styling

2.4 Organizing the view using the Document Object Model 2.4.1 Working with the DOM using JavaScript

2.4.2 Finding a DOM node

2.4.3 Creating a DOM node

2.4.4 Adding styles to your document

2.4.5 A shortcut: Using the innerHTML property

2.5 Loading data asynchronously using XML technologies 2.5.1 IFrames

2.5.2 XmlDocument and XMLHttpRequest objects

2.5.3 Sending a request to the server

2.5.4 Using callback functions to monitor the request

2.5.5 The full lifecycle

2.6 What sets Ajax apart 2.7 Summary 2.8 Resources Chapter 3: Introducing order to Ajax 3.1 Order out of chaos 3.1.1 Patterns: Creating a common vocabulary

3.1.2 Refactoring and Ajax

3.1.3 Keeping a sense of proportion

3.1.4 Refactoring in action

3.2 Some small refactoring case studies 3.2.1 Cross-browser inconsistencies: Façade and Adapter patterns

3.2.2 Managing event handlers: Observer pattern

3.2.3 Reusing user action handlers: Command pattern

3.2.4 Keeping only one reference to a resource: Singleton pattern

3.3 Model-View-Controller 3.4 Web server MVC 3.4.1 The Ajax web server tier without patterns

3.4.2 Refactoring the domain model

3.4.3 Separating content from presentation

3.5 Third-party libraries and frameworks 3.5.1 Cross-browser libraries

3.5.2 Widgets and widget suites

3.5.3 Application frameworks

3.6 Summary 3.7 Resources Chapter 4: The page as an application 4.1 A different kind of MVC 4.1.1 Repeating the pattern at different scales

4.1.2 Applying MVC in the browser

4.2 The View in an Ajax application 4.2.1 Keeping the logic out of the View

4.2.2 Keeping the View out of the logic

4.3 The Controller in an Ajax application 4.3.1 Classic JavaScript event handlers

4.3.2 The W3C event model

4.3.3 Implementing a flexible event model in JavaScript

4.4 Models in an Ajax application 4.4.1 Using JavaScript to model the business domain

4.4.2 Interacting with the server

4.5 Generating the View from the Model 4.5.1 Reflecting on a JavaScript object

4.5.2 Dealing with arrays and objects

4.5.3 Adding a Controller

4.6 Summary 4.7 Resources Chapter 5: The role of the server 5.1 Working with the server side 5.2 Coding the server side 5.2.1 Popular implementation languages

5.2.2 N-tier architectures

5.2.3 Maintaining client-side and server-side domain models

5.3 The big picture: Common server-side designs 5.3.1 Naïve web server coding without a framework

5.3.2 Working with Model2 workflow frameworks

5.3.3 Working with component-based frameworks

5.3.4 Working with service-oriented architectures

5.4 The details: Exchanging data 5.4.1 Client-only interactions

5.4.2 Introducing the planet browser example

5.4.3 Thinking like a web page: Content-centric interactions

5.4.4 Thinking like a plug-in: Script-centric interactions

5.4.5 Thinking like an application: Data-centric interactions

5.5 Writing to the server 5.5.1 Using HTML forms

5.5.2 Using the XmlHttpRequest object

5.5.3 Managing user updates effectively

5.6 Summary 5.7 Resources Chapter 6: The user experience 6.1 Getting it right: Building a quality application 6.1.1 Responsiveness

6.1.2 Robustness

6.1.3 Consistency

6.1.4 Simplicity

6.1.5 Making it work

6.2 Keeping the user informed 6.2.1 Handling responses to our own requests

6.2.2 Handling updates from other users

6.3 Designing a notification system for Ajax 6.3.1 Modeling notifications

6.3.2 Defining user interface requirements

6.4 Implementing a notification framework 6.4.1 Rendering status bar icons

6.4.2 Rendering detailed notifications

6.4.3 Putting the pieces together

6.5 Using the framework with network requests 6.6 Indicating freshness of data 6.6.1 Defining a simple highlighting style

6.2.2 Highlighting with the Scriptaculous Effects library

6.7 Summary 6.8 Resources Chapter 7: Security and Ajax 7.1 JavaScript and browser security 7.1.1 Introducing the 'server of origin' policy

7.1.2 Considerations for Ajax

7.1.3 Problems with subdomains

7.1.4 Cross-browser security

7.2 Communicating with remote services 7.2.1 Proxying remote services

7.2.2 Working with web services

7.3 Protecting confidential data 7.3.1 The man in the middle

7.3.2 Using secure HTTP

7.3.3 Encrypting data over plain HTTP using JavaScript

7.4 Policing access to Ajax data streams 7.4.1 Designing a secure web tier

7.4.2 Restricting access to web data

7.5 Summary 7.6 Resources Chapter 8: Performance 8.1 What is performance? 8.2 JavaScript execution speed 8.2.1 Timing your application the hard way

8.2.2 Using the Venkman profiler

8.2.3 Optimizing execution speed for Ajax

8.3 JavaScript memory footprint 8.3.1 Avoiding memory leaks

8.3.2 Special considerations for Ajax

8.4 Designing for performance 8.4.1 Measuring memory footprint

8.4.2 A simple example

8.4.3 Results: How to reduce memory footprint 150-fold

8.5 Summary 8.6 Resources Chapter 9 - Autocomplete Dropdown Chapter 10 - AJAX Portal Chapter 11 - XSLT phonebook Chapter 12 - RSS Reader Appendix A: The Ajax craftsperson's toolkit A.1 Working smarter with the right toolset A.1.1 Acquiring tools that fit

A.1.2 Building your own tools

A.1.3 Maintaining your toolkit

A.2 Editors and IDEs A.2.1 What to look for in a code editor

A.2.2 Current offerings

A.3 Debuggers A.3.1 Why use a debugger

A.3.2 JavaScript debuggers

A.3.3 HTTP debuggers

A.3.4 Building your own cross-browser output console

A.4 DOM inspectors A.4.1 Using the Mozilla DOM Inspector

A.4.2 DOM inspectors for Internet Explorer

A.5 Installing Firefox extensions A.6 Summary A.7 Resources Appendix B: JavaScript for object-oriented programmers B.1 JavaScript is not Java B.2 Objects in JavaScript B.2.1 Building ad hoc objects

B.2.2 Constructor functions, classes, and prototypes

B.2.3 Extending built-in classes

B.2.4 Inheritance of prototypes

B.2.5 Reflecting on JavaScript objects

B.2.6 Interfaces and duck typing

B.3 Methods and functions B.3.1 Functions as first-class citizens

B.3.2 Attaching functions to objects

B.3.3 Borrowing functions from other objects

B.3.4 Ajax event handling and function contexts

B.3.5 Closures in JavaScript

B.4 Summary B.5 Resources

Соседние файлы в папке video