Pathfinder Development

Pathfinder Blog

Topic Archive: Books

Book review: Advanced Ajax by Lauriat (Part 2 of 2)

Advancedajax

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.

Continue reading »

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..

Continue reading »

Topics: Books

Buy My Book! (Please?)

223888 cover_df.pdf (3 pages).jpg
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.

Continue reading »

Topics: Books, Ruby on Rails

Book review: Advanced Ajax by Lauriat (Part 1 of 2)

Advanced Ajax

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.

Continue reading »

Ajax security surprises: web-aggregators, offline applications and frameworks

Ajaxsecurity

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]

Continue reading »

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."

Technorati Tags: ajax, gwt, books

Topics: Books, GWT

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.

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

Topics: Books, GWT

Review of GWT in Action

[image]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:

Introduces you to the central ideas of GWT: compiling Java in JavaScript and debugging in Java. Does a good job of touching on most of the features of GWT -- widgets, internationalization, JRE emulation library, RPC, browser history, etc. -- and illustrating them with code samples. Finishes off with a complete client-side (no RPC) tic-tac-toe example app. Things slow down a bit here, as the authors delve into the organization of a GWT project and the details of the GWT development cycle. I'm torn on whether this chapter could have been illustrated more clearly with an example application, rather than just by enumerating the steps and components and diagrammatically illustrating the work-flow. The information that's here is solid and correct, but the approach seems to conflict with the learn-by-example used so well in the rest of the book. Begins the process of developing the Dashboard application -- essentially a web desktop or portal with draggable component apps. It makes concrete the more abstract development life cycle notions of the previous chapter. At the end of this chapter you have a skeleton application with menus,
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

Topics: Books, GWT

GWT in Action - Two Sample Chapters

gwt-in-action.gifRobert 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.

 
  Technorati : ajax, books, gwt

Topics: Books, GWT

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:

Chapter 1 covers what must already be fairly familiar to most GWT developers -- making an RPC call to a backend servlet. This chapter, however, does an exceptionally good job of explaining the why and how of GWT RPC in exhaustive detail. The Yahoo Trips application is used to illustrate how to proxy an RSS feed. Chapter 2 shows how to integrate third party Javascript libraries with GWT. In this case Scriptaculous is used to provide an effect in the Yahoo Trips application to the panel containing the search results. The chapter focuses on two ways to incorporate scripts in the app -- simply including script tags in the application html file, and GWT script injection, i.e. through the GWT config file. Chapter 3 shows one way of how to implement drag and drop with GWT, using a fairly OO approach. The code seems pretty reusable and useful. Again, the Yahoo! Trips app is used. Chapter 4 shows how to bring GWT into the mix. Most of it is old hat for experienced Hibernate hands, but the example does work through implementing a sort of remote DAO using the GWT RPC. It's always good to see how that is done, even if it looks simple on paper. The Address Book app is used for this example. Chapter 5 shows how to use ant to deploy your apps to Tomcat. I assume most everyone is using Googlipse or some non-free alternative, but writing ant files for automated build environments is still a useful thing to know. Chapter 6 illustrates the use of popups and "deferred commands." Popups are obvious (modal and modeless dialogs); deferred commands are a way of giving focus to widgets that have not yet been displayed. I really haven't seen good treatment of this aspect of GWT programming elsewhere. Uses the Address Book app for this example.

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.



Technorati : ajax, book, digital shortcut, google web toolkit, gwt, review, tutorial

Review of ‘Pro Ajax and Java Frameworks’

bcm.gif

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.

Chapter 2 covers the tools of the Ajax development trade -- IDE's, debuggers, HTTP monitors, logging, testing, etc. -- and provides links to where these tools can be downloaded. While those tools that are mentioned -- Venkman, Selenium, Firebug -- are all solid and useful, there is usually only one tool in each category. For Javascript editing, Aptana for Eclipse deserved a mentioned, as did JSMin and Packer for Javascript compression. While Venkman is a great tool for debugging and profiling in Firefox, the various solutions for IE are not addressed. Still, the tools are all solid choices, and the tutorial alone on how to debug Ajax with Selenium is worth the price. Chapter 3 looks at three (four if you count Scriptaculous, which is based on Prototype) Javascript Ajax libraries -- Prototype, Taconite and Dojo. Each library is treated with some brief but useful examples along with a short example on how to use them to integrate with a servlet or JSP on the server. As always seems to be the case, Dojo seems to get short shrift. In fairness, dealing with Dojo is probably a worthy subject for an entire book of its own. Chapter 4 looks at Direct Web Remoting (DWR) and AjaxTags. The chapter consists mostly of the basic syntax and workings of the frameworks and a few simple examples.

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.

Chapter 5 is probably the most useful chapter in the book. For those maintaining Struts applications -- and there are a lot of them out there -- it provides a detailed blow by blow on how to turn a simple Struts-based form validation into an Ajax powered on using Prototype. This example doesn't address all possible uses of Ajax, but it does give you a clue on exactly where to splice the Ajax magic into the Struts infrastructure. Chapter 6 looks at the Tacos (Ajax enabled) components of the Tapestry framework. This is the first chapter that seems to voilate the book's guiding principle: it spends the lions share of its length in explaining the workings of Tapestry rather than focusing on how to add Ajax to it. Chapter 7 combines DWR and the Spring framework to develop a simple inventory control system. Again. lots of time is taken in explaining Spring and relatively little in showing how to add in the Ajax with DWR. Chapter 8 shows two ways of adding Ajax to JSF, one with a roll your own approach using raw XHR and no libraries. The other using some Ajax JSF components from the Apache Tomahawk project. Again, too much time is spent explaining vanilla JSF and not enough with the Ajax enhancements. I would have like to see more written on both using and developing Ajax components, since the component is, after all, the heart of JSF.

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.



Technorati : ajax, book review, frameworks, java

Topics: Books, Review

Review of Practical Ajax Projects with Java Technology

pract_ajax.gif 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.

Chapter 1 gives a good overview of Ajax and the paradigm shift in web development that has caused. It also prompts the reader to consider questions such as when, where and why to use Ajax, as well as considering when fat clients or Flash are more appropriate for a Rich Internet Application (RIA). Chapter 2 is a crash course on Javascript, DOM, CSS and XML. You'll see some variation on this chapter in most beginning Ajax books, but this one does a better job than most. There are a few technical nits I have, mostly with inheritance. Specifically, the code in the book 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.

Chapter 4 is a type-ahead suggestion application ala Google Suggest, i.e. you type in a few letters and it brings in a selectable list of possible completion. The example makes use of AjaxTags, part of the Java Web Parts (JWP) tag library. If you want to quickly add in Ajax to an existing application that incorporates JSP, this is one way, although after looking at all of the the different configuration and other files you have to write or modify (web.xml, ajax_config.xml, jsp, javascript, java), you might not think it's so easy. Chapter 5 demonstrates the use of Direct Web Remoting (DWR) for developing a POP3 web email client. Most of the language in the chapter is taken up with development and explanation of the Javascript code that makes the application tick. Chapter 6 develops an RSS reader using the Ajax tags from Java Web Parts (JWP) and the ROME RSS parser library. Among other things, this example illustrates how to deal with cross browser security restrictions, i.e. how do you grab RSS feeds and content from third party sites. Chapter 7 develops an image manipulation and sharing application called PhotoShare using Dojo! and the JWP tags. Dojo is truly huge in its scope and this chapter focuses on just two packages: Events and I/O. This app definitely has the most wow factor of the bunch. There's something about manipulating and sharing images that makes you say, "you can't do that with a webapp." Chapter 8 develops the first application in the book to make use of a database. The example program is an organizer and makes use of Prototype, WebWork, Spring and hsqldb. Chapter 9 implements a chat application based on Struts and custom Javascript code not based on any library. This might have made a good chapter 2 application, since we get to go a little deeper into the practical workings of Ajax. It also illustrates the technique of "pushing" updates to the browser via periodic polling of the server. Chapter 10 is also "naked" Ajax, i.e. no toolkit or framework. It is a rather fun little game in the style of Zork called Ajax Warrior. This is the first time we get to see JSON. The application also kicks the handling of XML, both on the client and server side, up by several notches. This is the most complex application and illustrates some strategies for implementing a complex flow. Ironically, this application is probably the easiest to understand because it makes no used of Ajax/Javascript libraries and could have made for a good Chapter 3.

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.



Technorati : ajax, book review, java

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:

Cookie Storage Provider - uses cookies to persist the hash table Flash Storage Provider - uses Flash's SharedObjects to persist data ActiveX Storage Provider - uses COM's File APIs to persist data XPCOM Storage Provider - uses XPCOM's File APIs to persist data Form Storage Provider - uses the text autosave features of a hidden form to save transient data (the Really Simple History library uses this trick) WHAT WG Storage Provider - uses native browser persistence to store data, as defined by the WHAT Working Group. IE Storage Provider - uses IE's proprietary abilities to store up to 60K of data.

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.


Technorati : ajax, book review, javascript

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:

"Ajax Hacks (Hacks)" "Programming Atlas" "Sams Teach Yourself AJAX in 10 Minutes (Sams Teach Yourself in 10 Minutes)" "Pro Ajax and the .NET 2.0 Platform (Pro)" "Ajax Patterns and Best Practices (Expert's Voice)" "Pro JSF and Ajax: Building Rich Internet Components (Pro)" "Beginning JavaScript with DOM Scripting and Ajax: From Novice to Professional (Beginning: from Novice to Professional)" "Professional Ajax (Programmer to Programmer)" "Foundations of Ajax (Foundation)" "Foundations of Atlas: Rapid Ajax Development with ASP.NET 2.0" "Pragmatic Ajax: A Web 2.0 Primer" "Ajax For Dummies (For Dummies (Computer/Tech))" "Ajax And Php: Building Responsive Web Applications" "Build Your Own Ajax Web Applications" "Ajax in Action" "Head Rush Ajax" "Ajax: Your visual blueprint for creating rich Internet applications (Wiley Visual Imprint)" "Ajax Design Patterns"

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:

The network blows up and extends into areas not strictly related to Ajax. Atlas books form a distinct subnet of their own. There are somewhat smaller distinct subnets along language lines: PHP, Ruby, Java, etc. Javascript/DHTML/CSS is central to the network, with the exception of the Atlas/.NET subnet. Interesting. It looks like Ruby programmers are reading up on OOAD.

ajax3.png

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:


"Ajax in Action" "Professional Ajax (Programmer to Programmer)" "Head Rush Ajax" "Ajax Patterns and Best Practices (Expert's Voice)" "DOM Scripting: Web Design with JavaScript and the Document Object Model" "Foundations of Ajax (Foundation)" "Hibernate in Action (In Action series)" "DOM Scripting: Web Design with JavaScript and the Document Object Model" "Programming Ruby: The Pragmatic Programmers' Guide, Second Edition" "Bulletproof Web Design: Improving flexibility and protecting against worst-case scenarios with XHTML and CSS" "CSS Mastery: Advanced Web Standards Solutions (Solutions)" "Professional JavaScript for Web Developers (Wrox Professional Guides)" "Ajax Design Patterns"

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.


Technorati : ajax, books, social network analysis

Topics: Books

About Pathfinder

We design and build extraordinary applications for companies looking to make the next great idea a reality. learn more

Topics

.NET 3d 3D GPS Accessibility actionscript activerecord Add new tag ADO.NET Entity Framework Adobe Adobe AIR Advertising agile Agile Development AIR Ajax Ajax Applications Ajax Bookmarking Ajax Components Ajax Development Ajax Examples Ajax Frameworks Ajax Intervention Ajax libraries AJAX Obfuscation Ajax Performance Ajax Products Ajax Tools Ajax Widgets Analysis Android Announcement Announcements antennae Apollo Application Architecture Application Development ASP.NET Asynchronous Processing awards Back Button Benchmarking Best Practices BitmapData.draw BJAX Blaze Advisor blog blogging Books Browsers Business Reasons for Ajax Business Rules C# Canvas Case Studies Chicago CMS COBOL Code Generation Color COMET Conference Consistency Content Management CRM CSS Custom Flex Component Degrafa Design Design Patterns Desktop Desktop RIA Developer's Notebook Diagnose Dojo Domain Knowledge Drools Echo2 Echo3 Editorial ERP Ethnographic Research Ext JS Facebook FileReference Firefox Firefox Extensions Flash flash awards flash player 10 Flex flexunit Flow Frameworks front end front end development Games Gauge Component Google Google calendar Google Gears Grails Graphics Greasemonkey Groovy GStreamer Gwittir GWT Healthcare Hibernate IDE Ideation IE IE6 IE7 IE8 ILOG JRules Information Architecture Innovation Instructional Design Interaction Design Interview iPhone iTunes Java Javascript JavaScript frameworks Javascript Libraries JBoss Rules Jess Jetty Jobs jQuery JSF JSON JSR-94 Lazlo Legacy Systems lightweight LinkedIn LINQ Logical Model and Conceptual Model Low Pro Mac Mash Note Mashups MetaWidget Methodology Microformats Microsoft Mobile Mootools Mozilla Music MVC MySql Object-Oriented Object Relation Mapping (ORM) Office OOP Open Screen Open Source Opera ORM pagination Pair Programming papervision3d Patterns Peer Creation Performance Personas PHP plugin preloader process Web/Tech Progressive Enhancement Project Website