Book review: Advanced Ajax by Lauriat (Part 2 of 2)
Back in February, I reviewed the first half of Shawn M. Lauriat's "Advanced Ajax: Architecture and Best Practices" (Prentice Hall, 2008, 360p). The first four chapters of Lauriat's book, which focused almost exclusively on client-side technologies, impressed me considerably. But it's taken me several weeks to get through the remainder of the book, and there's one reason why: PHP.
The server-side portion of "Advanced Ajax" uses PHP code to illustrate its many and varied lessons about Ajax architecture. It's not that I have anything against the popular web-development framework and scripting language. It's just that, after spending my career in the ASP Classic and JSP trenches and slowly ramping up on Rails in the last year, I'm not the ideal target audience for these code samples. Adding "PHP" to the title of the book might have limited its potential audience, but it also would have been more accurate.
That said, there's a lot of value here for adherents of any server-side framework. Lauriat discusses each topic from a general perspective before diving into the code. The technical approach to a given problem would obviously differ by framework, but the high-level approach wouldn't. If you don't mind skimming past the content that doesn't apply to you, Lauriat's advice about developing stable, scalable, accessible and secure Ajax applications transcends framework allegiance.
Topics: Ajax Development, Books, Review
Programming Languages, O’Reilly & The State Of Java
There are some interesting charts for the State of the Computer Book Market at of O'Reilly, viewing popularity of programming languages based on book sales for 2007. No surprise here: Java seems to be in decline, and Ruby on the rise.
This is obviously good news on the Ruby front, but I begin to wonder about the rest of the story-- who these readers are, and how many of them might have come from a Java background and how that has affects sales of Java books. The article seems to dichotomize C# & Java, but I don't believe that's a very fair comparison..
Topics: Books
Buy My Book! (Please?)

This week, my book Professional Ruby on Rails will be officially released. You can see sample chapters here, and you can buy the book at Amazon (affiliate link).
This book is designed to meet the needs of an intermediate to advanced Ruby on Rails user. The first wave of Rails books could not assume that the user had any pre-existing knowledge of Rails. As a result, they spent a lot of time covering the basics. The target reader for this book is somebody who has already read one of the basic books and now has to apply this knowledge to building a complete web site all the way from conception to deployment.
Written over the summer and fall, all the sample code in the book uses Rails 2.x, specifically including RESTful structures, respond_to, new migrations, cookie-based sessions, and other new features.
Topics: Books, Ruby on Rails
Book review: Advanced Ajax by Lauriat (Part 1 of 2)

Because Ajax moves so much application logic from the server to the client, it forces many developers to master a wider range of web technologies than ever before. To work effectively on Ajax projects, front-end developers have to concern themselves with database performance, business logic and other server-side concerns. Back-end and middleware developers, meanwhile, have to make friends with XHTML, CSS, JavaScript and a wide range of browsers. Sure, it's possible to develop Ajax apps in a siloed team environment. But it's not the easiest way, and it rarely provides the strongest results.
Shawn M. Lauriat's "Advanced Ajax: Architecture and Best Practices" (Prentice Hall, 2008, 360p) bridges the gap between developers with exclusive client- or server-side skills. By exploring tools, technologies and best practices for every layer of the Ajax programming model, this solid new programming manual promises to plug the holes in any developer's resume. Lauriat's tops-to-tails approach offers something for almost any developer, but it also guarantees most readers will find some sections remedial. As this two-part review will demonstrate, that's not necessarily a liability.
Topics: Ajax Development, Books, Review
Ajax security surprises: web-aggregators, offline applications and frameworks

I'm still absorbing the densely packed information from "Ajax Security," the first-rate book by Billy Hoffman and Bryan Sullivan that I recently recommended in these pages. Here, in no particular order, are three of the most surprising lessons imparted by Messrs. Sullivan and Hoffman:
Web aggregators and SSL
This is probably a great big "duh" to some developers, but web aggregators such as iGoogle and NetVibes often compromise the security of otherwise SSL-encrypted web applications when funneling content from them to your personalized homepage:
Now, consider what happens when you use a Gmail widget on an aggregate site like NetVibes. Sharp-eyed readers will notice the URL for NetVibes ... is http://www.netvibes.com. This is not an encrypted connection! NetVibes sends user data in the clear from the aggregate to the user.... NetVibes makes an SSL connection to Gmail, and then NetVibes degrades the level of security by transmitting the data over an unencrypted connection. Our attacker ... can steal the data much more easily now. NetVibes is not providing the same level of security that a user would receive if he accessed Gmail directly. This situation is not unique to NetVibes and Gmail.... At the time of publication, every major aggregate Web site the authors examined downgraded security on data from secure sources. [emphasis theirs]
Topics: Best Practices, Books, Review, Security
GWT Conference: David Geary’s Cool and Useful Stuff
David Geary is a prolific author and experience speaker. In a sense, this was a mini preview of his book, Google Web Toolkit Solutions: More Cool & Useful Stuff, which I will be reviewing in the upcoming weeks. His presentation went through building a custom widget, implementing drag and drop, and viewports (like google maps). You can see the demo apps and download the code from the books demo site.
Some David Geary quotes:
"AWT was developed by a handful of people in six weeks. And for those of you who have used AWT you probably believe that."
"The reason why they could develop AWT so quickly was because it used peers. GWT uses peers, namely DOM elements."
"DOM has more than 80 public methods. When I wrote that a few weeks ago, it actually had 83 methods. Knowing how hard it is to remove methods from a public API, I feel comfortable saying that."
"GWT doesn't itself support drag-and-drop, but you can do it yourself, and it is ridiculously easy."
"My answer to everything is addStyleName
"We went through the Struts filter. We went from building cool web applications with drag-and-drop to writing boring ass web applications that battered users over the head with one form after another. Now, with GWT, we are back to writing cool applications for the web."
Agile Publishing
I'm currently working on my third technical book (Professional Ruby On Rails, available in February, wherever fine technical books are sold). Each one has had a slightly different process, in chronological order...
I submitted each chapter on completion directly to the Development Editor (DE) in charge of the book. Within a few days, she returned a well-commented revision.
I submitted each chapter on completion, as before. However, the DE did not turn around an immediate review. Instead, at the 1/3, 2/3, and finish points, the partial manuscript was sent to external people for review.
I submitted each chapter on completion. There is no intermediate review. Upon completion of the whole thing, it's sent to a technical editor to review code and a copy-editor for content.
Version three is a classic waterfall model -- all development is complete before any testing happens, and all revision happens in the next phase before the book moves on to the final production phase. Version one is about as close to agile as you'll get in the publishing world (with the possible exception of Pragmatic), and version two is somewhere in the middle.
Well, I got to thinking about these experiences as a kind of controlled experiment, with me as the common element and trying to measure what, if any, difference the process makes to the eventual outcome.
The quality of the feedback makes a huge difference. In the first process, feedback came directly from the editor and was detailed and useful. In the current process, feedback is coming from copy and technical editors contracted by the publisher -- it's not quite as detailed about issues of style, but they are quite thorough about, say, when a reader might be confused by the text. In the other process, review was handled by outside volunteers, and we got a lot of "I didn't quite make it through the entire manuscript, but here are some thoughts on chapter one" -- there was very little in these reviews that was useful.
I'm not sure whether a more agile process makes a difference in the final quality of the book, but it definitely makes a difference in the efficiency of the review. For example, the copy editor had an issue with a stylistic thing that I did. If I had gotten that feedback early, I could have incorporated it into later writing. As it is, the copy editor is going to have to flag this issue throughout the manuscript. There are similar issues with the technical editor and misinterpreted code instructions. The ending point will be the same, but the editors and I wind up doing some extra work.
That said, there's a clear efficiency win purely from the publisher's side in that they only have to manage the review editors for a period of about six weeks, rather than the about six months they'd be on the hook if chapters were being reviewed on turn-in. I don't think it's much of a financial difference -- they get paid for the same amount of work either way, but it's easier for the publisher and editor to schedule in the waterfall model.
From my perspective, the waterfall model is terrifying. Since there's no formal feedback on the manuscript until it's complete, I put in months of work before finding out whether it's acceptable. That's a huge potential risk, both for me and for the publisher. As it happens, the feedback has been quite good and there don't seem to be any showstopper problems. Still, I think it would have been nice for everybody to confirm that the road being walked down was, in fact, the right road.
I'm not sure the sample lends itself to big conclusions, but I think it's fair to say the faster iteration process is more manageable and efficient from the author point of view.
Topics: Agile Development, Books, Ruby on Rails
The JavaRanch GWT in Action Review
After reading a comment at Ajaxian on my GWT in Action review, I thought I'd mosey on over to the JavaRanch to read their, presumably, harsh review and see why I had totally missed the boat on this book. Well, not so harsh, as it turns out:
I felt that the book was trying to reach too broad an audience. For beginners without an understanding of JavaScript/HTML/DOM, I think it is overwhelming. The book provides "what's new in GWT 1.4", but the book is overkill for someone already using GWT. Most of the time the book treats what happens under the hood of GWT as magic and other times it becomes important. This switching of focus is a bit confusing.
Fair enough. Would this book be on point for a beginner? Maybe not. It's hard for me to say, since I'm not really a beginner in all of these domains. The book is trying to hit a broad audience, and from the preface (since I've started reviewing books, I always read the preface) they say they are targeting everyone from JavaScript developers, to Java server-side developers, to web designers. They add that the reader should have a good understanding of Java classes and packages. That seems to narrow it down to Java developers again. Unlike the authors, I don't think that Java and the use of Eclipse is something you can just sort of pick up as you read along.
Still, I do think the book is a good one. This is not just another Java package or framework; this is a whole new way of writing apps in the browser and the subject is expansive and complex. The book just reflects that -- it isn't just 600 pages of pictures, white space and padding. Could the examples have been more useful and relevant to typical webapp developers? Sure. I point that out in my review, but even with that flaw, I found the book very useful. And in all fairness, focusing on implementing a full-on Spring/Hibernate backend to the GWT app would have easily doubled the size of the book, larded in lots of unnecessary technologies, and given the critics (many of whom are disgruntled JavaScript programmers) even more ammunition.
Some readers will have noted that publish generally positive reviews. That's not because I'm a shill for the publishers, but rather that I put really awful books down pretty early in the process. Generally, books for which I end up publishing reviews are interesting and worth reading. For bad books, I could summarize my review in one sentence: don't waste your time. I guess maybe I should publish a list of the tech books that suck; that could be a long list.
Technorati Tags: ajax, book review, gwt
Review of GWT in Action
Any time a hot technology comes along -- and GWT is certainly white-hot -- publishers compete in a mad scramble to get the first books out the door. Often quality suffers. I am happy to report that GWT in Action is a strong effort that doesn't seem to suffer from this quality problem. (That isn't to say there aren't any errors and omissions in the book, just no obvious ones that I've found in my reading of it.) Instead, the book offers a solid, learn-by-example approach to understanding the Google Web Toolkit.
This learn-by-example approach, tied together through the development of a dashboard application over the course of several chapters, strikes, I think, the right balance for a broad audience. This is not the reference "bible" for GWT, though it does contain more reference material in one place than any other source so far, so you'll have to wait for that sort of reference work. But for anyone wanting to get a jump start on GWT, start developing applications, and understand what all the fuss is about, I heartily recommend this book.
The book is organized into 17 chapters, split into four parts: Getting started; Building user interfaces; Advanced techniques; Completing the understanding. So, on to what's in the book, chapter by chapter:
a trash icon and some basic CSS styling, and you will have run it (and debugged in Eclipse for hosted mode) in
both hosted and web mode. This chapter attempts to instill good behavior by adding i18n ("internationalization" with the 18 letters between the "i" and the "n" omitted) at the very beginning. That way if you leave it our of your apps, you have no one to blame but yourself. You'll also have a good understanding of the major project files: the HTML file, the EntryPoint, and the module XML file. The start of Part 2 of the book which introduces GWT "widgets" -- in short, GUI components. Dissects their dual nature as Java objects and DOM elements and introduces the basic GWT widget set. Covers several common GUI and Web concepts, such as DOM events, focus, keypresses, etc. Shows two different ways of developing custom widgets -- one from scratch by manipulating the DOM and the other, the PNGImage to support transparent PNG's in IE6, by extending an existing widget class. Finishes off by building the first two custom widgets for the dashboard application, the TwoComponentMenuItem and the ToggleMenuItem. The full details of building the PNGImage class, using GWT's technique of deferred binding to handle browser differences, is split between here and Chapter 15. Small nit: I think the concept is important enough to have merited a section of its own in this chapter or the other. Presents the basic concepts of GWT panels -- the containers that hold widgets and other panels. If you know Swing, this will all seem pretty familiar, in particular DeckPanel, FlowPanel and DockPanel should seem familiar. (It is interesting to note that in GWT, layout is specified through inheritance (Is A FlowPanel), while in Swing it is a pluggable behavior (layout manager).) Of course, remember to pay no attention to the HTML Table behind the curtain, at least not if you want your code to keep working when the implementation changes. The chapter finishes off by extending DialogBox to a DashboardPanel that can be used and manipulated in a multi-window interface (or MDI). Focuses on Events, both Browser/DOM events and it's custom Widget events. This is a long chapter (over 50 pages) and covers lots of territory. If you already know your way around Java and the various kinds of Listeners, you've won a quarter of the battle, but you may want to brush up on the browser side of the equations a little bit before reading it (see here, here and here). Not that the chapter doesn't do a good job of presenting the material, but sometimes you need to have a firm grasp of one topic before combining it with another, and I think this is definitely one of those times. The chapter finishes off by implementing drag-and-drop for the Dashboard app, combining the widget knowledge from the previous two chapters with your new understanding of events. Composite widgets are again old hat if you have experience with Swing. Basically you combine existing widgets into "mega" widget. This chapter illustrates the concept by walking your through the implementation of three composite widgets: EditableLabel, ColourPicker (Colour=Color, for the Yanks in the audience), and the DashboardComposite framework class. Introduces JSNI (JavaScript Native Interface), essentially a way of fooling your IDE and the Java compiler into ignoring embedded JavaScript in your GWT code, while allowing the GWT Java to JavaScript compiler to make use of it. Demonstrates wrapping the Google Video and Ajax search libraries with JSNI. Gets into the nitty gritty of how GWT modules are put together. Essential if you are going to build reusable libraries and components that can be included in GWT applications. Really, this is where you start to find out about the inner workings of GWT, the XML, the JavaScript, etc. This chapter could stand to be a bit more in-depth. Don't skip over it in any case. The start of Part 3 of the book -- advanced techniques. Introduces GWT-RPC, i.e. the GWT abstraction over XMLHttpRequest. Make sure you have a firm grasp of XMLHttpRequest before you delve into this chapter (see here and here). Again, it helps to be well versed in the basics when something new is introduced. The chapter does a good job of explaining perhaps one of the more confusing bits of the GWT -- two execution environments (client and server), three Java classes, Sync, Async, callbacks, and the IsSerializable interface. Also show how to use the typeArgs annotation to give hints to the GWT compiler (not something you usually see in online tutorials). Digs into the client-side part of RPC. Offers patterns for simplifying the GWT-RPC code through the Facade, Singleton and Command patterns. Examines ways to implement both server pull (GWT-RPC polling) and push (blocking server threads, but see also GWT and Comet - Using GWT with Jetty Continuations). Also explains custom field serializers -- needed for some complex objects or objects that don't implement IsSerializable or have a zero argument constructor. Covers the more traditional ways of doing Browser/Server communication, with the traditional XHR style RequestBuilder, parsing the returned XML data with XMLParser, and traditional postback with FormPanel. Introduces JSON (JavaScript Object Notation) and the GWT classes that support it. It wouldn't hurt to review the basics of JSON a bit more here, but it's not quite as important as in chapters 6 and 10. Demonstrates its application through use of the Yahoo Search API. Shows how to use JSON to integrate with Java, Perl and Ruby on the server. The latter examples are fairly simple, but they give you enough to start rolling your own. (FYI, you can also do JSONP with GWT.) GWT generators are a compile-time mechanism for generating new classes based on parameters (used from JUnit, logging, RPC, etc.). Builds on the module knowledge from chapter 9. This chapter gets deep into the inner workings of the compiler. As it turns out, you can do introspection in GWT, but only at compile time. Gets into various runtime and compile-time parameterization of GWT apps, specifically i18n, constants, dynamic constants (client side associative arrays) and browser specific code. This is where you have to go to understand exactly what you did with the PNGImage class. The start of Part 4 of the book. Covers a number of topics: JUnit and GWT, testing async code and deploying GWT apps on the client and server sides. The JUnit and async testing piece really should be a chapter on its own. The section on deploying GWT apps points out many of the hidden pitfalls packaging up an app, such as the old or unused files generated during development that need to be removed for a slim package. This chapter is the natural continuation of chapters 9 and 14. It delves even deeper into the inner workings of GWT, such as the compilation process and the generated and static JavaScript files that make up an application. It also gives a quick tutorial on how to diagnose problems on the client side using the PRETTY and DETAILED styles of JavaScript output.
The book does cover many of the new features in GWT 1.4, such as Image Bundling, the new loading mechanism, and the Serializable vs IsSerializable changes. Some of the new widgets, such as the Rich Text Editor, are not covered, however.
As I've said, overall a fine effort. I do have three issues with the book, however. First, there is no mention of the incompatibility between GWT and IE7. Since much of the world's population still uses IE7, that's a major oversight. It would have been nice to at least mention the hack to UserAgent.gwt.xml to make it work for IE7. The other issue is that the rich UI sample Dashboard application really deserved a transactional companion, i.e. some sort of app that illustrates how GWT would function with a more substantial server-side app. That may be a little too much to ask of one book that tries to introduce so many new concepts and ideas already, and there are some online tutorials that provide just that sort of example.
the Finally, testing with JUnit is relegated to the penultimate chapter of the book. Software development is momentum and habit. If you start off developing without unit tests, you will have a hard time incorporating it into your process later on. Testing should have been presented in the first chapter and used throughout in each subsequent chapter, so as to givereader a good grounding in JUnit and GWT.
Still, the three issues certainly don't detract enough from the book to change my overall opinion: definitely read this book.
Technorati Tags: ajax, gwt in action, book review
GWT in Action - Two Sample Chapters
Robert Hanson has been an early adopter of GWT and was one of the first to release third party widget libraries and demonstrate how to integrate Javascript libraries like Scriptaculous. His blog has been a source of aid and comfort to many an aspiring GWT developer. Now he has published a book, with Adam Tacy (not quite out yet, but soon) in the "in Action" series, entitled -- you guessed it -- "GWT in Action."
While you can't get it yet, you can get two sample chapters (pdf):
Looking through the chapters, I don't see anything on developing your own widgets from scratch, nor does chapter 4 above include anything in that area. When I get my hands on a copy, I will post a review.
Mini Review - Google Web Toolkit Solutions: Cool & Useful Stuff
A mini book deserves a mini review, and so it is with the "Digital Shortcut" from January 2007 entitled Googleâ„¢ Web Toolkit Solutions (Digital Short Cut): Cool & Useful Stuff. The 112 page PDF goes further than any of the free tutorials out there in that it develops two non-trivial applications using GWT: a Yahoo! Trips app that uses proxied Yahoo web services, and an Address Book, that makes use of Hibernate persistence.
The applications are non-trivial in that they tackle complex use cases, backend processing, web service, backend persistence and the integration of third party Javascript frameworks -- all aspects of GWT application development that are of great interest to serious developers. (Source code available for download.) In order, the chapters cover the following:
Over all, the book doesn't skimp on explanations and code samples and is written in a clear style. It doesn't address unit testing with JUnit, but I suppose you can get that information elsewhere. For those of you who like to learn by doing, this is a decent tutorial (and worth the $10 price tag) that can tide you over until the bigger GWT tomes come out.
Topics: Ajax Frameworks, Books, GWT, Tutorials
Review of ‘Pro Ajax and Java Frameworks’
This is a review of Pro Ajax and Java Frameworks by Nathaniel T. Schutta and Ryan Asleson. This book seeks to give the experienced developer of Java web applications the knowledge necessary to add Ajax to their webapps. This is another Ajax book that goes broad rather than deep. Instead of investigating one or two frameworks, it delves into more than a half dozen, both Javascript and Java.
Quick summary: Chapters 2, 3 and 5 are the strongest in the book with useful information on tools, Javascript libraries and enhancing Struts applications with Ajax. The other chapters are not as strong and spend too much time covering old ground.
The book is divided into two parts. Part 1 is an introduction to a variety of Javascript and Java Ajax libraries and frameworks. Part 2 shows how to integrate those libraries and frameworks into existing Java web frameworks such as Struts and JSF. One place that this book differs from other Ajax books is that it doesn't have a chapter introducing the reader to the browser technologies that comprise Ajax. It doesn't dwell on the basics of Javascript, DOM and CSS. It expects you to have already read the Apress books on those topics. Instead, chapter 1 covers what I would call best practices and patterns -- autocomplete, partial page update, draggable DOM.
Part 2, as previously mentioned, builds on what the reader has learned about the preceeding Ajax frameworks and libraries and looks at integrating them into existing non-Ajax web application frameworks.
Summary: As previously mentioned, this book goes broad rather than deep in picking out more than a half dozen frameworks and libraries. Also, the examples throughout the book are little more than snippets, not applications that would demonstrate the development of a full Ajax app. Still, there are a wealth of tool and library tutorials and Ajax conversion best practices in it to make it a valuable reference for anyone looking to enhance a legacy webapp with Ajax.
Review of Practical Ajax Projects with Java Technology
At a quiet time during my 40th birthday extravaganza, I finally had the chance to finish reading Practical Ajax Projects with Java Technology by Frank Zammetti from Apress. I've read enough good, hands-on Apress books by now to get a warm and fuzzy feeling anytime I see their distinctive bumble bee black and yellow covers, so I came to this volume hoping to find an Ajax treatment in that mold. The result isn't an unqualified success in that regard -- it goes broad rather than deep -- but if you're an experienced Java developer looking to get caught up on some of the Ajax developments of the last year and a half, this book is for you.
The book assumes a good foundation in server-side Java development, but little or no experience with the technologies that make up Ajax. Part 1 of the book, which is comprised of Chapters 1-3, is an excellent review of Ajax technology and architecture along with a basic review of Java webapp development. Part 2 consists of seven chapters, each of which develops an Ajax application.
MySubclass.prototype = MySuperclass.prototype should really be something like MySubclass.prototype = new MySuperclass() so that modifications to the subclass's prototype don't affect the superclass. Otherwise, both the superclass and subclass inherit from the same prototype and are siblings rather than parent-child. But beyond this small technical oversight, the chapter is quite strong. Chapter 3 is a review of Java web application development using open source technologies, specifically ant, Tomcat, JSP's, Servlets and Jakarta Digester. If you're already familiar with Java webapp development, you can safely skip this chapter. The one exception to this condition is if you've only worked with commercial application servers and just need a quick kickstart on the open source tools.As we said previously, part 2 consists of seven chapters, each of which develops an Ajax application. Each application makes use of a different Ajax framework or toolkit, so the treatment of each is not particularly deep. One other curious thing about the examples is that the last two don't make use of frameworks while the first five do. This seems a bit backwards to me, since frameworks provide a level of abstraction over the underlying technology which hides its workings. As a result, you end up not understanding the why and how of how it works. I would have started with simpler projects in the first two chapters that made no use of frameworks, going on to higher level of abstraction as we moved along.
Throughout the book, DTO, DAO and other classic Java webapp patterns are used and extended to work with Ajax and client-side Javascript. For those who haven't used Spring or some of the other open source Java libraries demonstrated in these applications, there is even some non-Ajax learning involved. Zammetti's writing is clear and to the point and his humor doesn't get in the way of reader understanding.
My main issue with the book -- a lack of depth -- is really more a problem with Ajax itself and the proliferation of frameworks. In truth, despite its depth, the book barely scratches the surface of what's out there now in terms of frameworks. The great pace of development means that since this book was put to bed, probably in the third quarter of 2006, several of the frameworks used in the chapters, such as Dojo and Prototype, have seen one or more releases. Still, this is a problem any Ajax book that references frameworks will have to deal with. Despite these shortcomings, I recommend this book to any Java developer who is looking to "learn by doing" with Ajax.
Topics: Ajax Applications, Books
Mini review of “JavaScript: The Definitive Guide, 5th Edition”
The latest edition of the venerable tome JavaScript: The Definitive Guide is a sorely needed update. I guess it took Ajax, Web 2.0, and an intervening five years to revive interest in in this quirky client-side language. The fourth edition, while still providing a good formal specification of the language, had fallen woefully out of date both with some of the new features introduced in the browser versions and in terms of practical examples of how JavaScript is being used to enable Ajax and Web 2.0 applications.
I don't mean to give a full review of a thousand plus page book here. Rather, I just want to focus on the chapter that covers client-side persistence. In the fourth edition, the corresponding chapter only discussed "cookie scripting." While this chapter does talk about cookies, it delves into a number of other options for persisting data on the client.
Unfortunately, for a book that describes itself as the "definitive guide", it only discusses three options for persistence: cookies, IE userData persistence and Flash SharedObjects. This coverage is far from definitive. In fact, Brad Neuberg in his discussion of dojo.storage enumerates seven different client-side storage mechanisms:
Maybe this is just a sign that the use of JavaScript has grown so far beyond what was common or even thinkable in 2001 that it is simply isn't possible to write a definitive guide, at least not in a thousand pages. Would you buy a book called "Java: The Definitive Guide?" Probably not.
What is there -- the discussion of Flash SharedObjectsand IE userData persistence -- is pretty brief in comparison to the exhaustive treatment of cookie persistence. It does give you a basic description and enough code samples to get you started, but a cookbook it is not. The section on persistence alternatives has the feeling of an afterthought -- something shoehorned into the book relatively late to address Ajax and Web 2.0. In fact, many parts of the client-side portion of the book have that feel.
I think the book is still worth buying as a language reference, if only for its treatment of closures and object creation, but for now you'll have to look online for more detailed, exhaustive, and "definitive" treatment of many topics.
Topics: Books, Javascript, Review
Social Network Analysis of Ajax Books
I've done this sort of analysis a few times, first with Knowledge Management, then with Business Rules Engines. I felt it was about time to do it for Ajax books. First some explanations.
This is a little game I play with Amazon. All you need is a starting list of important Ajax books. For each book, you find out on Amazon that "customers who bought this book also bought..." a bunch of other books. You take those new books and repeat the process until either no new books show up or you run out of patience and disk space. Then you put your results, a so-called directed graph, into a file and load it up in the nice and free graph analysis tool, Pajek, to see what sort of structure you can discern.
The 18 books I started out with were the following:
After three iterations, we've come up with a list of 121 books. You can find the Pajek network file for this list here.
Some initial observations:
You can analyze this data until the cows come home, but to keep things simple, I've taken an approach very similar to the one used by Google: hubs and authorities. In simple terms, authorities are the books that all the other ones point to, and hubs are the books that point to a lot of authorities. (See here for details.) We'll leave aside whether it's better to be a hub or an authority; let's just agree that it's good to be either. In the graph above, the yellow nodes are authorities, the red nodes are hubs, and the green nodes are both. I've pulled together the "important" nodes below:
Now some of the books in this network may have been released relatively recently and so haven't worked their way up the "also bought" list. Thats why I like to run this analysis once a year or so. If there are any books you think I should have included in my initial seeding, please let me know.
Topics: Books



