Foreword

This book is going to give you a ton of technical information about building AJAX applications with Microsoft technologies. But before you dive into the details, spend a few minutes with me here talking about why you want to do it and some ways to think about it.

AJAX, by name, has been popular for a few years. The technology, though, has been in use for quite a long time. Early versions of Microsoft’s Outlook Web Access pioneered the space to some extent. Although this was limited to Internet Explorer and used proprietary extensions, the implementation started to demonstrate what could be done in a Web application and that not every feature required a page view. Since then, many more applications have adopted the techniques.

AJAX has since become a buzzword. If your application doesn’t use it, developers say, "This would be so much better with AJAX." Marketers say, "We need some AJAX." Technical press say, "It’s not very AJAXy." And the technical geek crowd say, "It’s so Web 1.0." But your users won’t use that word. In fact, they’ve most likely never even heard of AJAX unless they’re technical folks themselves. Aunt Sylvia doesn’t worry herself with any of this. Ask her what a "page view" is, and she’ll give you one of those "why do I care about this?" looks.

What users will notice is their experience, and this is where great applications can take advantage of AJAX. Enhancing the user experience and driving efficiency (for the user or your application) are certainly noble goals, and AJAX can certainly help satisfy these goals.

Much of this book will discuss service-oriented architecture and how to go about designing services to work well with your Web application. Even in the absence of AJAX, designing your application in this way will yield dividends in the future, and with the introduction of technologies like Windows Communication Foundation (WCF), this is easier than ever. Service design forces you to think about how to carve up your application into discrete chunks, and it will get you thinking about how to group functionality in ways that will reduce the communication between your application and the browser.

Many AJAX applications will offload processing from the server to the browser, and it’s here that you must be careful. You have a few variables to work with as you do your design:

  • Server CPU (database, application server, Web server)

  • Network utilization

  • Client CPU (in the browser)

That’s pretty much it. There are other variables, such as local browser storage and such, but these three are the most important ones. As you turn dials in your application, a shift occurs between these variables.

Server CPU is pretty straightforward—you understand your database and your application logic, and you have a general idea about what’s expensive and what’s not. Hopefully, by designing your services cleverly, you’ve carved up the problem into smaller, more manageable chunks, which makes CPU management across a server farm somewhat easier to plan.

Network utilization is important to think about. In today’s world of high-speed data connections, it’s easy to forget your users who might be on the road with some sort of cellular connection. Some 3G networks, for example, can be quite fast in terms of throughput, but they may have dreadful latencies. The only way you’ll know how this affects your application is to try it. Test!

Client CPU is a bit of a wildcard. As of this writing, the spread in JavaScript execution performance between the top four desktop browsers is a factor of 10. So the fastest browser in common use will process JavaScript a full 10 times faster than the slowest (according to published tests). Not to mention mobile browsers, which can be dramatically slower yet. Test on all of the browsers you can! I’ve used an application that is as smooth as silk on one browser but that on another browser brings the client computer to its knees for seconds at a time. This is hard to predict—test!

At NewsGator, our enterprise product line makes use of AJAX, using many of the techniques described in this book, including service-based architecture. This approach has allowed us to deliver the user experience we want, limit the number of certain expensive API calls back to the server, deliver asynchronous updates to users, and even increase the usability of some built-in SharePoint capabilities by eliminating long page loads.

You’re in the business of building Web applications or you wouldn’t be reading this book. Make them the best they can be—functional, responsive, intuitive, and attractive. Use AJAX to solve problems; use it to make things better for the user. It’s one more tool in your toolbox, and it’s a powerful one.

Greg ReinackerCTO and FounderNewsGator Technologies, Inc.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset