Skip to Main Content
Google Wave: Up and Running
book

Google Wave: Up and Running

by Andres Ferrate
March 2010
Intermediate to advanced content levelIntermediate to advanced
304 pages
8h 23m
English
O'Reilly Media, Inc.
Content preview from Google Wave: Up and Running

Gadget Design

Even though Google Wave gadgets and generic Google gadgets share similar structure and functionality, some design considerations are specific to Google Wave gadgets. The following sections serve to highlight some of the design considerations that you may want to consider as you start developing gadgets. They’re based in part on the “Google Wave Gadgets API Reference” documentation (http://code.google.com/apis/wave/extensions/gadgets/reference.html).

Programming Logic

Developing gadgets is fairly straightforward. However, you should take the following considerations into account for the programming logic you will use with gadgets.

Do not attempt to access objects during initialization

Gadgets rely on callbacks for a variety of things, including the initial function processed when a gadget is added to a wave. The gadgets.util.registerOnLoadHandler(init) method is used to declare the initial function (in this case the function is named init).

Because a wave’s state and participants do not have any accessible values until their callbacks have fired, you should refrain from attempting to access these objects within the initial function. Instead, register callback functions within the initial function using the appropriate callback methods (wave.setStateCallback and wave.setParticipantCallback). This will ensure that your code does not run into any issues trying to apply methods to undefined objects.

Most of the logic should be inside of callbacks

Your code should rely on relevant ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Google™ Search and Tools in a Snap

Google™ Search and Tools in a Snap

Preston Gralla
SUSE™ Linux 10 Unleashed

SUSE™ Linux 10 Unleashed

Michael McCallister

Publisher Resources

ISBN: 9781449378646Errata PagePurchase book