June 10th, 2008 PLEASE FORWARD
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Tips, Tricks, News and Reviews for Web Coders
by Kevin Yank (techtimes@sitepoint.com)
Read the HTML version of this newsletter, with graphics, at:
http://www.sitepoint.com/newsletter/viewissue.php?id=3&issue=193
IN THIS ISSUE - - - - - - - - - - - - - - - - - - - - - - - - - -
- Introduction
- Rollin' with App Engine, 80's Style
- New Technical Articles
- More Techy Blog Entries
SPONSOR'S MESSAGE - - - - - - - - - - - - - - - - - - - - - - - -
Our web developer customers can sleep at night.
Your job is building great websites for your clients. Lying awake at
night wondering if those sites are accessible is not.
That's why we maintain Fully Redundant Network Operations Center
capabilities from two cities 24/7/365. So you can impress your clients
and still get some shut-eye.
Find out why 3.1 million websites call The Planet home.
Dedicated servers start at just $89:
http://www.eztrackz.com/tracking.aspx?id=85813
INTRODUCTION - - - - - - - - - - - - - - - - - - - - - - - - - -
Welcome to the new, weekly Tech Times! Our schedule will see a
new issue in your inbox every Tuesday, so sit tight and we'll
keep the stream of hot, buttery web technology flowing. (Ew.)
This issue, Andrew Tetlaw dives head first into the Google App
Engine [1] platform. I briefly covered App Engine back in issue
#188 [2], but now that Google has opened it up to all developers
and announced pricing [3], it's worth a closer look.
Meanwhile, thousands of developers have gathered in San
Francisco for Apple's Wordwide Developers Conference 2008 [4].
The spotlight at WWDC is on the new iPhone 3G and the iTunes App
Store, which is launching in July to bring (officially) native
apps to iPhone and iPod touch devices, but web developers have
been eyeing MobileMe [5], Apple's relaunch of the .Mac service.
For users of Gmail, Google Calendar, and Picasa Web (or any of
the competitors from Yahoo! and Microsoft), MobileMe is a new
contender that promises to automatically push your online
changes into desktop applications like Microsoft Outlook and
mobile devices like the iPhone (and vice versa). Unlike its
competitors, however, MobileMe shows no signs of offering open
APIs for other web applications to integrate with the service.
The other big difference between MobileMe and its competitors is
that MobileMe costs $99 a year. On the one hand, you can use free
services that integrate with an ever-expanding range of web apps
and web-enabled desktop applications; on the other hand, you can
pay for a service that only integrates seamlessly across
supported devices and desktop apps.
Speaking as a card-carrying Mac fan, I'll be sticking with my
non-Apple web apps for now. Thanks to their open APIs, I can use
a free service like Plaxo [6] to sync them to my desktop software
and devices. The experience isn't quite as seamless as what
MobileMe will offer, but it's close, and as a developer it's
comforting to know that my data is only a well-documented API
call away.
[1] <http://code.google.com/appengine/>
[2] <http://www.sitepoint.com/newsletter/viewissue.php?id=3&issue=188>
[3] <http://googleappengine.blogspot.com/2008/05/announcing-open-signups-expected.html>
[4] <http://developer.apple.com/wwdc/>
[5] <http://www.apple.com/mobileme/>
[6] <http://www.plaxo.com/>
ROLLIN' WITH APP ENGINE, 80'S STYLE - - - - - - - - - - - - - - -
Building a web application with Google App Engine is quick and
easy, and you have the power of the Google distributed content
delivery network and the 'BigTable' database at your disposal.
So what's it good for?
When I was 14 my Dad bought a Commodore 64. I pored over the
manuals, taught myself C64 BASIC, bought C64 programming
magazines and created a stack of audio cassettes full of
unfinished projects. It was awesome fun being able to create
sounds and make things happen on screen.
Then about 2 years later I discovered girls and didn't become
interested in technology again for some years. I often wonder if
I could have reached Bill Gates-like heights if only I had
continued to apply myself to technology instead of skinny gray
ties, white pants and Blue-Light discos.
Dave Winer said [1] that because of Google App Engine, "Python is
the new BASIC". And my first experience with App Engine did indeed
generate that same sense of fun that C64 BASIC did way back in my
embarrassing youth. With zero Python experience and just the
App Engine guestbook tutorial [2] under my belt, I managed to
build a functional (albeit utterly pointless), slightly amusing
web service called "Now Roll..." [3]. Now Roll.. simulates
Dungeons and Dragons-style dice rolling. It was straight forward
and simple to create -- I'm talking push-button simple. Google
App Engine is my new Commodore 64.
So what exactly is Google App Engine? Well, it includes most of
the pieces you usually need to assemble together to create a web
application. It has a simple framework component called 'webapp',
a database referred to as the 'datastore', and a deployment
system. Once completed you can deploy your web application to
run on Google's infrastructure. It also has a fully functional
local development environment that is a duplicate of the live
environment.
Once you download [4] and install the SDK You can start
practicing with the local development environment straight away,
but to deploy an application you have to register your app first
with your Google account, which includes account confirmation
via SMS. The free accounts are also limited to 3 applications --
I assume to avoid 5 million variations of "Hello, world!" being
deployed. But this limitation might only be during the
preview-release period.
I have two big tips for beginners: complete the Getting Started
[5] tutorial and use the Launcher application (which is bundled
with the SDK) to build your first project. When you add a new
web application using the Launcher app, it generates an
application shell for you, all the files needed for a basic web
app, that you can run straight away. It only outputs "Hello
world!", but it works. Once you have the shell, you can start
playing!
[1] <http://www.scripting.com/stories/2008/04/08/earlyNotesOnGoogleapps.html>
[2] <http://code.google.com/appengine/docs/gettingstarted/>
[3] <http://nowroll.appspot.com/>
[4] <http://code.google.com/appengine/downloads.html>
[5] <http://code.google.com/appengine/docs/gettingstarted/>
SPONSOR'S MESSAGE - - - - - - - - - - - - - - - - - - - - - - - -
Learn the Greatest Hits of PHP
The PHP Anthology. Save time, and eliminate the frustration of
completing PHP5 tasks, with this comprehensive collection of
ready-to-use solutions.
* Build functional forms, tables, and SEO-friendly URLs.
* Reduce load time with client-and server-side caching.
* Produce and utilize web services with XML.
* Secure your site using access control systems.
* Easily work with files, emails, and images.
* And much more... Too much to mention here!
Order a copy today! Available in PDF or hardcopy format.
https://sitepoint.com/bookstore/go/120/1cde39/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
A basic GAE application has the following components:
- An application configuration file called app.yaml in which
you specify routes (or URL patterns) and the Python script file
that will be executed if the requested URL matches the pattern.
- One or more script files (as specified in the app.yaml file)
that each specify a list of URL patterns and the Python classes
responsible for handling the URLs.
- One or more request handling classes that define a get and/or
a post method in order to be able to handle HTTP GET or POST
requests to the specified URL patterns. They read the requests
and compose the responses, for which there's a templating engine
you can use.
- Optionally, one or more model classes that define the data
structure of the entities you want to store in the datastore.
I won't go into too much detail here (you can check out the blog
post [1] for that) but I will discuss the datastore a bit. There
are no tables in the GAE datastore, your Python model classes
define the data structure and the datastore automatically
handles storage, retrieval and index generation. Items in the
datastore are known as 'entities'.
In my Now Roll... application I want to store every dice roll
and to do so I use this DiceRoll class:
class DiceRoll(db.Model):
roll = db.StringProperty()
results = db.ListProperty(int)
outcome = db.IntegerProperty()
date = db.DateTimeProperty(auto_now_add=True)
A model class is very simple; it provides a type name (a 'kind'
in GAE parlance): DiceRoll, and a list of named properties to
store for each entity. To store an entity you create a new
instance of your model class, set the property values and then
call the object's put method.
dr = DiceRoll()
dr.roll = '2d6'
dr.results = [1,2]
dr.outcome = 3
dr.put()
The entity is now in the database. All entities automatically
receive a unique identifier that you can retrieve using the
object's key() method like so:
key = dr.key()
You can retrieve a specific entity from the datastore using its
key like so:
roll = db.get(key)
You can run datastore queries using an API or GQL, Google's
SQL-like query language. If I wanted to add a feature to my Now
Roll... app that listed the last 10 dice rolls in reverse date
order, the query would look something like this using the API:
rolls_query = DiceRoll.all().order('-date')
rolls = rolls_query.fetch(10)
The equivalent query using GQL is:
rolls = db.GqlQuery("SELECT * FROM DiceRoll "
"ORDER BY date DESC LIMIT 10")
This is all very simple and quite straight forward. For more
complex relationships you can define an entity to be the parent
of one or more other entities and then use that relationship in
queries.
Deployment to the Google servers is literally a single click on
the button labeled 'Deploy' if you use the Google App Engine
Launcher client. There is zero setup required for this; once
deployed, your app is live and distributed.
That's Google App Engine in a nutshell. There's a handful of
other App Engine modules you can make use of like image
manipulation, caching and the Users API for integration with
Google Accounts.
Even though GAE has a collection of useful libraries, it's
noticeably missing a testing framework. Frameworks like Rails
have done a lot to popularize the use of unit testing
frameworks, so its absence may turn some developers away. It'd
be a nice feature as well to have one-click unit testing to
match the ease of the one-click deployment feature.
Kevin has mentioned previously [2] that although it's friendly
to beginners, applications need to be written specifically for
GAE, which is likely to deter some developers from making use of
the platform. Although I imagine it's possible to write a
separate module to interface your existing application with the
Google framework, I wonder, if you already have a commercial
application and a team of developers, if it's worth your time to
port it to GAE.
The datastore may also trip up a few developers as they grapple
with its non-relational nature. For example, the problem of
counting records [3] in the datastore has already come up in the
GAE forum. You cannot simply do a COUNT(). But, I expect that as
more developers sign up for the platform, more usage patterns
will be developed and tested and best-practice usage patterns
[4] will eventually rise to the top.
One thing I predict GAE will be an excellent platform for is
single-purpose web services. I'm not talking something frivolous
like dice rolling, but something useful like a data collection
service or an image manipulation service. A small, generic
component that can be used in a larger application but separated
out and hosted on GAE to save application resources. A great
example is this OpenID Provider [5] app enabling you to sign
into any site supporting OpenID using your Google Account
credentials.
One aspect of GAE that I haven't seen mentioned anywhere else
yet is that it integrates with Google Apps for Your Domain. When
you create a GAE application you can limit access to your
registered domain users: hello company intranet! With GAE, GAfYD
becomes a complete software solution for organizations,
especially distributed organizations. I can see huge cost
savings for a company that can avoid having to purchase servers
and bandwidth and the ongoing administration costs of an
intranet.
For me though, apart from the mundane commercial aspects, Google
App Engine represents something like the Commodore 64. You know, a
personal computer that doesn't do much on its own but is
flexible, programmable, inspiring, and fun. You use it to tinker
with stuff, finding out how stuff works, trying out ideas for new
gizmos, and building custom tools. It embodies the spirit of 80s
era personal computing (but without the fashion sense).
If you've tried Google App Engine, let me know what you think by
commenting on the blog entry:
Web Tech Blog: Technically Speaking
by Andrew Tetlaw
Rollin' With Google AppEngine, 80s Style
http://www.sitepoint.com/blogs/2008/06/11/rollin-with-google-appengine-80s-style/
[1] <http://www.sitepoint.com/blogs/2008/06/11/rollin-with-google-appengine-80s-style/>
[2] <http://www.sitepoint.com/newsletter/viewissue.php?id=3&issue=188&format=html>
[3] <http://groups.google.com/group/google-appengine/browse_thread/thread/d1260a3deb31dbf7>
[4] <http://blog.appenginefan.com/2008/06/efficient-global-counters.html>
[5] <http://appgallery.appspot.com/about_app?app_id=agphcHBnYWxsZXJ5chMLEgxBcHBsaWNhdGlvbnMYrwIM>
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
That's all for this issue -- thanks for reading! We'll see you again next week!
Kevin Yank & Andrew Tetlaw
mailto:techtimes@sitepoint.com
Editors, The SitePoint Tech Times
SPONSOR'S MESSAGE - - - - - - - - - - - - - - - - - - - - - - - -
Morae: Usability Testing for Software & Web Sites. An all-digital tool
that enables you to:
-Quickly identify website and software design problems
-Affordably conduct user testing. Quickly calculate metrics & graph results.
-Deliver professional results in a fraction of the time.
http://www.techsmith.com/morae.asp?cmp=StPtUX3
NEW TECHNICAL ARTICLES - - - - - - - - - - - - - - - - - - - - -
Create a 3D Product Viewer in Flex 3
by Jack Herrington
If you're going to experiment with Flex 3, you might as well
create something cool, right? With only a small amount of code,
Jack shows you how to create an awesome 3D model of a light
cycle from the movie Tron that your users can view, rotate,
change the color of, and more!
http://www.sitepoint.com/article/1646
MORE TECHY BLOG ENTRIES - - - - - - - - - - - - - - - - - - - - -
Design Blog: PIXEL PERFECT
Google Changes Favicon, Challenges You To Do Better (2 comments)
http://www.sitepoint.com/blogs/2008/06/10/google-changes-favicon-challenges-you-to-do-better/
ColdFusion Blog: INFUSED
10 Questions for Mark Mandel on Transfer ORM)
http://www.sitepoint.com/blogs/2008/06/09/10-questions-for-mark-mandel-on-transfer-orm/
PHP Blog: DYNAMICALLY TYPED
Last we checked, PHP IS a framework. (35 comments)
http://www.sitepoint.com/blogs/2008/06/08/last-we-checked-php-is-a-framework/
Ruby on Rails Blog: GET ON TRACK
This week in Rails - new release edition)
http://www.sitepoint.com/blogs/2008/06/07/this-week-in-rails-new-release-edition/
Web Tech Blog: TECHNICALLY SPEAKING
Why Yahoo's BrowserPlus has a long way to go)
http://www.sitepoint.com/blogs/2008/06/06/why-yahoos-browserplus-has-a-long-way-to-go/
ADVERTISING INFORMATION - - - - - - - - - - - - - - - - - - - - -
Find out what thousands of savvy Internet marketers already know:
email newsletter advertising works! (You're reading an email ad
now, aren't you?)
Find out how to get YOUR sponsorship ad in this newsletter and
reach 200,000+ opt-in subscribers! Check out
http://www.sitepoint.com/mediakit/ for details, or email us at
mailto:adinfo@sitepoint.com
HELP YOUR FRIENDS OUT - - - - - - - - - - - - - - - - - - - - - -
People you care about can take charge of their Website by
effectively using the information and resources available on the
Internet. Help them learn how - forward them a copy
of this week's SitePoint Tech Times.
ADDRESSES - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Send suggestions and comments to:
techtimes@sitepoint.com
To subscribe, send a blank email to:
subscribe@sitepoint.com
The Archives are located at:
http://www.sitepoint.com/newsletter/archives.php
The SitePoint Tech Times is hosted by SparkList:
http://www.sitepoint.com/newsletters/sparklist/
The SitePoint Tech Times is (c) 1998-2008 SitePoint Pty. Ltd. All
Rights Reserved. No part of this Newsletter may be reproduced in
whole or in part without written permission. All guest articles
are copyright their respective owners and are reproduced with
permission.
SitePoint Pty. Ltd.
48 Cambridge Street
Collingwood, VIC 3066
AUSTRALIA
You are currently subscribed to The SitePoint Tech Times as:
ignoble.experiment@arconati.us
To change the email address that you currently subscribe with:
http://sitepoint.com/newsletter/manage.php
To switch to the HTML version of this newsletter:
<http://sitepoint.com/newsletter/htmlplease.php?email=ignoble.experiment@arconati.us>
To leave this list:
<http://sitepoint.sparklist.com/u?id=2266608.e57363ef99c8b59c8667cca2fd106cbe&n=T&l=techtimes&o=2077251>
Do Not Reply to this email to unsubscribe.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
No comments:
Post a Comment
Keep a civil tongue.