Originally published on: Sat, 10 Oct 2009 01:37:47 +0000

Book title: Using Google App Engine Edition: First Edition ( May 2009 ) Author: Charles Severance Publisher: O'Reilly | Google Press Cover Price: $29.99 ( U.S. )
I've been interested to try out some of the free Cloud Computing offerings that are rising into vogue. The one that looked to have the lowest barrier-to-entry, was the Google App Engine (GAE).
I downloaded the local GAE development environment ( the Python flavor, not the Java edition ) and walked through the series of examples in Google's tutorial. Through the tutorial, I received a little exposure to the Datastore service and the Django-compatible templating mechanism. It was a nice enough introduction, but I wanted to know more.
I searched for some GAE books and found some good reviews of this text. I ordered a copy.
What I Skimmed
The book is a nice enough introduction to web programming in general. It contains chapters covering the mechanics of web transactions, the history of HTML and CSS, and a 30-page introduction to programming in Python ( 2.5 ).
I skimmed through these chapters as I suspect a fair number of web developers would do. I did briefly go through the Python tutorial and found it to be concise and informative. Actually, it begins as an introduction to general programming using Python.
A guess-the-number game is provided which serves as a reference model for some of the concepts. If they haven't already, they should snip this section out as a PDF and give it away.
The tutorial manages to introduce control-flow, strings, functions, lists, dictionaries and objects in a short span of pages.
I completely skipped the chapters that describe how to install the GAE development environment on various platforms. The author covers installation on Windows XP, Windows Vista, Mac OS, and Linux. No specific Linux distribution is cited. The installation instructions are probably similar for most distributions.
The Good Stuff
The book does a good job in leveraging the Django-compatible templating mechanism. I had seen some of these templates before, but was not overly impressed with the mechanism until I saw them use a convention that I wasn't used to.
In normal templating systems that I'm used to, it's common to leverage an include directive to pull in common snippets of HTML and/or other template code for common headers, footers, and such. The convention that the author used for the Django templates was different.
In the template scheme he used, a baseline template is defined with a "body" section. All other templates refer to this baseline template and override the content of the body section; they contain only the changes to that section.
In a way, this is kind of like an object-oriented document system that observes the inheritance property of OOP. If one wants to make look-and-feel changes, they would likely only have to change the baseline template.
Later examples illustrate how to override multiple blocks of text in the baseline template.
The author takes the reader through some pretty fair examples. He builds a web equivalent to the guess-the-number game to show the reader how a desktop console application and a web application differ in code and execution. He does a good job introducing the reader to CGI programming.
He then builds a real-time chat application leveraging JQuery for a smooth AJAX interface to the web app. He proceeds to build a functioning, multi-user web chat system.
We are introduced to the Datastore, the memory cache (memcached) interface, and the logging mechanism.
I enjoyed seeing some of the administrative console features. One can view the logs and can also invoke Python code interactively, which I find to be quite liberating. It's nice to have a REPL ( read-evaluate-print-loop ) that will let you interact with the same back-end objects that your web code is using.
Please note that I have yet to actually try out any of this code. I assume that it works properly. I also assume that any errors in the code are corrected in an errata section somewhere on the web.
What I Didn't Care For
The author spent some time building a session mechanism based on the memcached interface. This mechanism did not seem to be backed up by persistent writes to the Datastore as memcached is a volatile cache. The author admitted that the cache could end up removing the cached session info.
It's my understanding that GAE provides a users class that provides a login mechanism and ( I would hope ) a persistent session object. I don't know much about this, but it shows up in the Google helloworld.py application on the Google tutorial. It would have been nice to see how this works in the printed text.
The author mentions the HTTP form-file upload, but never mentions how the GAE framework can be made to process file uploads. It's not really essential to the book, but I'm kind of curious as to why it was referenced in the first place, unless he wanted to describe the mechanics used to publish one's Python code and supporting files to the GAE cloud.
Closing Thoughts
Overall, I would recommend ( and have recommended ) the book to friends. It's a nice intro that has some diverse foundational information that would seem to make the book accessible to quite a broad audience.
Unless otherwise noted, all code and text entries are Copyright ©2009 by James K. Lawless
Save to del.icio.us
Save to StumbleUpon
Digg it
Save to Reddit
Share on Facebook
Share on Twitter
More bookmarks
Subscribe!
Auto Save Clipboard Images Redux
Extending SpiderMonkey JavaScript on Windows
Rhino JavaScript to EXE with launch4j
Compiling Rhino JavaScript to Java
Directory Traversal in Rhino JavaScript
A Command-Line MP3 Player for Windows
Auto Save Images from the Clipboard
Java in a Windows EXE with launch4j
An Interview with Tom Zimmer: Forth System Developer
Setting Windows Console Text Colors in C
Switching a Console Window to Full Screen or Windowed Mode
BSave and BLoad for the Commodore 64
Internet Protocols and Rhino JavaScript
Compiling Rhino JavaScript to Java
Preventing Windows Screen-Saver Activation
Stacking Images with PerlMagick
An Interview with Game Developer James Hague
MicroISV on a Shoestring
DadHacker
The Bottom Feeder
Writin' That Code!
The Recursive ISV
The Thomsen Blog
Prototypically Speaking
The Reinvigorated Programmer