<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Dimitri Glazkov &#187; Uncategorized</title>
	<atom:link href="http://glazkov.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://glazkov.com</link>
	<description>Web and About</description>
	<lastBuildDate>Fri, 03 Feb 2012 03:33:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='glazkov.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Dimitri Glazkov &#187; Uncategorized</title>
		<link>http://glazkov.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://glazkov.com/osd.xml" title="Dimitri Glazkov" />
	<atom:link rel='hub' href='http://glazkov.com/?pushpress=hub'/>
		<item>
		<title>Wrap Your Head Around Gears Workers</title>
		<link>http://glazkov.com/2008/06/02/gears-workers/</link>
		<comments>http://glazkov.com/2008/06/02/gears-workers/#comments</comments>
		<pubDate>Tue, 03 Jun 2008 00:38:00 +0000</pubDate>
		<dc:creator>Dimitri Glazkov</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://glazkov.com/blog/gears-workers/</guid>
		<description><![CDATA[Google I/O was a continuous, three-thousand-person mind meld, so I talked and listened to a lot of people last week. And more often than not I discovered that Gears is still mostly perceived as some wand that you can somehow wave to make things go offline. Nobody is quite sure knows how, but everyone is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=glazkov.com&amp;blog=4127402&amp;post=161&amp;subd=glazkov&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>
Google I/O was a continuous, three-thousand-person mind meld, so I talked and listened to a lot of people last week. And more often than not I discovered that Gears is still mostly perceived as some wand that you can somehow wave to make things go offline. Nobody is quite sure knows how, but everyone is quite sure it&#8217;s magic.
</p>
<p>
It takes a bit of time to accept that Gears is not a bottled offlinifier for sites. It takes even more time to accept that it&#8217;s not even an end-user tool, or something that just shims between the browser and the server and somehow saves you from needing to rethink how you approach the Web to take it offline. That the primitives, offered by Gears, are an enabling technology that gives you the capability to make completely new things happen on the Web, and it is your, developer&#8217;s task to apply it to solve problems, specific to your Web application.
</p>
<p>
And it&#8217;s probably the hardest to accept that there is no one-size-fits-all solution to the problem of taking your application offline. Not just because the solution may vary depending on what your Web application does, but also because the actual definition of the problem may change from site to site. And pretty much any way you slice it, the offline problem is um, hard.
</p>
<p>
It&#8217;s not surprising then that all this thinking often leaves behind a pretty cool capability of Gears: the workers. Honestly, workers and worker pools are like the middle child of Gears. Everybody kind of knows about them, but they&#8217;re prone to be left behind in an airport during a family vacation. Seems a bit unfair, doesn&#8217;t it?
</p>
<p>
I missed the chance to see <span class="vcard"><span class="fn">Steven Saviano</span></span>&#8216;s presentation on Google Docs, but during a hallway conversation, it appears that we share <a href="http://glazkov.com/blog/gearhead/">similar thoughts</a> about Gears workers: it&#8217;s all about how you view them. The workers are not only for crunching heavy math in a separate thread, though that certainly is a good idea. The workers are also about boundaries and crossing them. With the cross-origin workers and the ability to make HTTP requests, it takes only a few mental steps to arrive at a much more useful pattern: the proxy worker.
</p>
<p>
Consider a simple scenario: your JavaScript application wants to consume content from another server (the vendor). The options are fairly limited at the moment &#8212; you either need a server-side proxy or use JSON(P). Neither solution is particularly neat, because the former puts undue burden on your server and the latter requires complete trust of another party.
</p>
<p>
Both approaches are frequently used today and mitigated by combinations of raw power or vendor&#8217;s karma. The upcoming <a href="http://www.w3.org/TR/access-control/">cross-site XMLHttpRequest</a> and its evil twin <a href="http://msdn.microsoft.com/en-us/library/cc288060%28VS.85%29.aspx">XDR</a> will address this problem at the root, but neither is yet available in a released product. Even then, you are still responsible for parsing the content. Somewhere along the way, you are very likely to write some semblance of a bridge that translates HTTP requests and responses into methods and callbacks, digestible by your Web application.
</p>
<p>
This is where you, armed with the knowledge of the Gears API, should go: A-ha! Wouldn&#8217;t it be great if the vendor had a representative, who spoke JavaScript? We might just have a special sandbox for this fella, where it could respond to our requests, query the vendor, and pass messages back in. Yes, I am talking about a cross-origin worker that acts as a <em>proxy</em> between your Web application and the vendor.
</p>
<p>
As Steven points out at his talk (look for the sessions on YouTube soon &#8212; I saw cameras), another way to think of this relationship is the <a href="http://en.wikipedia.org/wiki/Remote_procedure_call"><acronym title="Remote">RPC</acronym></a> model: the application and the vendor worker exchange messages that include procedure name, body, and perhaps even version and authentication information, if necessary.
</p>
<p>
Let&#8217;s imagine how it&#8217;ll work. The application sets up a message listener, loads the vendor worker, and sends out the welcome message (pretty much along the lines of the <a href="http://code.google.com/apis/gears/api_workerpool.html#example">WorkerPool API Example</a>):
</p>
<pre>
// application.js:
var workerPool = google.gears.factory.create('beta.workerpool');
var vendorWorkerId;
// true when vendor and client both acknowledged each other
var engaged;
// set up application listener
workerPool.onmessage = function(a, b, message) {
&nbsp;&nbsp;if (!message.sender != vendorWorkerId) {
&nbsp;&nbsp;&nbsp;&nbsp;// not vendor, pass
&nbsp;&nbsp;&nbsp;&nbsp;return;
&nbsp;&nbsp;}
&nbsp;&nbsp;if (!engaged) {
&nbsp;&nbsp;&nbsp;&nbsp;if (message.text == 'READY') {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;engaged = true;
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;return;
&nbsp;&nbsp;}
&nbsp;&nbsp;processResponse(message);
}
vendorWorkerId = workerPool.createWorkerFromUrl(
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'http://vendorsite.com/workers/vendor-api.js');
workerPool.sendMessage('WELCOME', vendorWorkerId);
</pre>
<p>
As the vendor worker loads, it sets up its own listener, keeping an ear out for the WELCOME message, which is its way to hook up with the main worker:
</p>
<pre>
// vendor-api.js:
var workerPool = google.gears.workerPool;
// allow being used across origin
workerPool.allowCrossOrigin();
var clientWorkerId;
// true when vendor and client acknowledged each other
var engaged;
// set up vendor listener
workerPool.onmessage = function(a, b, message) {
&nbsp;&nbsp;if (!engaged) {
&nbsp;&nbsp;&nbsp;&nbsp;if (message.text == 'WELCOME') {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// handshake! now both parties know each other
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clientWorkerId = message.sender;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;workerPool.sendMessage('READY', clientWorkerId);
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;return;
&nbsp;&nbsp;}
&nbsp;&nbsp;// listen for requests
&nbsp;&nbsp;processRequest(message);
}
</pre>
<p>
As an aside, the vendor can also look at <code>message.origin</code> as an additional client validation measure, from simple are you on my subdomain checks to full-blown OAuth-style authorization schemes.
</p>
<p>
Once both application and the vendor worker acknowledge each other&#8217;s presence, the application can send request messages to the vendor worker and listen to responses. The vendor worker in turn listens to requests, communicates with the vendor server and sends the responses back to the server. Instead of being rooted in HTTP, the API now becomes a worker message exchange protocol. In which case the respective processing functions, <code>processRequest</code> and <code>processResponse</code> would be responsible for handling the interaction (caution, freehand pseudocoding here and elsewhere):
</p>
<pre>
// vendor-api.js
function processRequest(message) {
&nbsp;&nbsp;var o = toJson(message); // play safe here, ok?
&nbsp;&nbsp;if (!o || !o.command) {
&nbsp;&nbsp;&nbsp;&nbsp;// malformed message
&nbsp;&nbsp;&nbsp;&nbsp;return;
&nbsp;&nbsp;}
&nbsp;&nbsp;switch(o.command)
&nbsp;&nbsp;&nbsp;&nbsp;case 'public': // fetch all public entries
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// make a request to server, which fires specified callback on completion
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;askServer('/api/feed/public', function(xhr) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var responseMessage = createResponseMessage('public', xhr);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// send response back to the application
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;workerPool.sendMessage(responseMessage, clientWorkerId);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;
&nbsp;&nbsp;&nbsp;&nbsp;// TODO: add more commands
&nbsp;&nbsp;}
}

// application.js
function processResponse(message) {
&nbsp;&nbsp;var o = toJson(message);
&nbsp;&nbsp;if (!o || !o.command) {
&nbsp;&nbsp;&nbsp;&nbsp;// malformed message
&nbsp;&nbsp;&nbsp;&nbsp;return;
&nbsp;&nbsp;}
&nbsp;&nbsp;switch(o.command) {
&nbsp;&nbsp;&nbsp;&nbsp;case 'public': // public entries received
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;renderEntries(o.entries);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;
&nbsp;&nbsp;&nbsp;&nbsp;// TODO: add more commands
&nbsp;&nbsp;}
}
</pre>
<p>
You could also wrap this into a more formal abstraction, such as the <a href="http://code.google.com/p/glazkov-attic/source/browse/trunk/html5-sql-player/scripts/worker/pipe.js">Pipe object</a> that I developed for one of my Gears adventures.
</p>
<p>
Now the vendor goes, whoa! <em>I have Gears.</em> I don&#8217;t have to rely on dumb HTTP requests/responses. I can save a lot of bandwidth and speed things up by storing most current content in a local database, and only query for changes. And the fact that this worker continues to reside on my server allows me to continue improving it and offer new features, as long as the message exchange protocol remains compatible.
</p>
<p>
And so you and the vendor live happily ever after. But this is not the only happy ending to this story. In fact, you don&#8217;t even have to go to another server to employ the proxy model. The advantage of keeping your own server&#8217;s communication and synchronization plumbing in a worker is pretty evident once you realize that it doesn&#8217;t ever block UI and provides natural decoupling between what you&#8217;d consider the <a href="http://en.wikipedia.org/wiki/Model-view-controller">Model</a> part of your application. You could have your application go offline and never realize it, because the proxy worker could handle both monitoring of the connection state and seamless switching between local storage and server data.
</p>
<p>
Well, this post is getting pretty long, and I am no <span class="vcard"><a class="url" href="http://steve-yegge.blogspot.com/">Steve Yegge</a></span>. Though there are still plenty of problems to solve (like gracefully degrading this proxy model to a non-Gears environment), I hope my rambling gave you some new ideas on how to employ the worker goodness in your applications and gave you enough excitement to at least give <a href="http://code.google.com/apis/gears/">Gears</a> a try.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/glazkov.wordpress.com/161/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/glazkov.wordpress.com/161/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/glazkov.wordpress.com/161/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/glazkov.wordpress.com/161/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/glazkov.wordpress.com/161/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/glazkov.wordpress.com/161/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/glazkov.wordpress.com/161/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/glazkov.wordpress.com/161/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/glazkov.wordpress.com/161/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/glazkov.wordpress.com/161/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/glazkov.wordpress.com/161/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/glazkov.wordpress.com/161/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/glazkov.wordpress.com/161/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/glazkov.wordpress.com/161/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/glazkov.wordpress.com/161/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/glazkov.wordpress.com/161/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=glazkov.com&amp;blog=4127402&amp;post=161&amp;subd=glazkov&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://glazkov.com/2008/06/02/gears-workers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d561e3aa24ea8e6878e99cd108429329?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dglazkov</media:title>
		</media:content>
	</item>
		<item>
		<title>.NET on Gears: A Tutorial</title>
		<link>http://glazkov.com/2008/01/31/gears-asp-net-tutorial/</link>
		<comments>http://glazkov.com/2008/01/31/gears-asp-net-tutorial/#comments</comments>
		<pubDate>Fri, 01 Feb 2008 02:30:00 +0000</pubDate>
		<dc:creator>Dimitri Glazkov</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://glazkov.com/blog/gears-asp-net-tutorial/</guid>
		<description><![CDATA[The google-gears group gets a lot of questions from .NET developers. So I decided to help out. In this tutorial, we will build a simple ASP.NET timesheet entry application (because, you know, everybody loooves timesheet entry). Then, we&#8217;ll bolt on Google Gears to eliminate any excuses for not entering timesheets. Say, you&#8217;re sitting 15,000 feet [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=glazkov.com&amp;blog=4127402&amp;post=119&amp;subd=glazkov&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The <a title="google-gears" href="http://groups.google.com/group/google-gears">google-gears group</a> gets a lot of questions from .NET developers. So I decided to help out.  In this tutorial, we will build a simple ASP.NET timesheet entry application (because, you know, everybody loooves timesheet entry). Then, we&#8217;ll bolt on <a title="Google" href="http://code.google.com/apis/gears/">Google Gears</a> to eliminate any excuses for not entering timesheets. Say, you&#8217;re sitting 15,000 feet above ground in cushy herd-class accommodations, with your laptop cracked about 60 degrees, keyboard pressed firmly against your chest, praying that the guy in front of you doesn&#8217;t recline.  This is the point where Google Gears comes to save you from yet another round of Minesweeper. You fire up your browser, point it to your corporate Intranet&#8217;s timesheet entry page and — boom! — it comes right up. You enter the data, click submit and — boom! — the page takes it, prompting your aisle-mate to restart the search for the Ethernet socket in and around his tiny personal space.  And after you cough up 10 bucks for the internet access at the swanky motel later that night, your browser re-syncs the timesheets, uploading the data entered offline to the server. Now, that&#8217;s what I call impressive. You can read more about features and benefits of Gears on <a title="Google" href="http://code.google.com/apis/gears/">their site</a> later. Right now, we have work to do (if you&#8217;d like, you can <a title="Source" href="http://glazkov-attic.googlecode.com/files/YourTimesheets-complete.zip">download</a> the entire project and follow along).</p>
<h2>Step 1: Create ASP.NET Application</h2>
<p>First, we start with the ASP.NET part of the application, which is largely drag-n-drop:</p>
<ul>
<li>Create new database, named YourTimesheets.</li>
<li>In this database, create a table Entries, with the following fields (you can also run <a title="Sql" href="http://glazkov-attic.googlecode.com/svn/trunk/YourTimesheets/Sql/">this script</a>):
<ul>
<li><var>ID</var> <kbd>int</kbd>, this will also be our identity field</li>
<li><var>StartDateTime</var> <kbd>datetime</kbd></li>
<li><var>DurationsMin</var> <kbd>int</kbd></li>
<li><var>Project</var> <kbd>nvarchar(100)</kbd></li>
<li><var>Billable</var> <kbd>bit</kbd></li>
<li><var>Comment</var> <kbd>ntext</kbd></li>
</ul>
</li>
<li>In Visual Studio 2005, create an ASP.NET project, also named YourTimesheets.</li>
<li>In design mode, drag SqlDataSource from Toolbox bar onto the <kbd>Default.aspx</kbd> file.</li>
<li> Specify the connection string using <var>SqlDataSource</var> designer, pointing to the newly created database (<a title="Create" href="http://picasaweb.google.com/dimitri.glazkov/NETOnGearsATutorial/photo#5161251416439115730">figure 1</a>). Save the connection string in <kbd>Web.config</kbd> (<a title="Save" href="http://picasaweb.google.com/dimitri.glazkov/NETOnGearsATutorial/photo#5161251429324017634">figure 2</a>).</li>
<li> Then, drag <var>GridView</var> onto the same design surface and connect it to the data source (<a title="Add" href="http://picasaweb.google.com/dimitri.glazkov/NETOnGearsATutorial/photo#5161251442208919538">figure 3</a> and <a title="Connect" href="http://picasaweb.google.com/dimitri.glazkov/NETOnGearsATutorial/photo#5161251450798854146">figure 4</a>).</li>
<li> Now, the input form. I added mine by hand, by you can use the same drag from Toolbox technique to get yours (<a title="Add" href="http://picasaweb.google.com/dimitri.glazkov/NETOnGearsATutorial/photo#5161251661252251682">figure 5</a>).</li>
<li> Hook up the form fields and <var>SqlDataSource</var> <var>INSERT</var> query (<a title="Bind" href="http://picasaweb.google.com/dimitri.glazkov/NETOnGearsATutorial/photo#5161251669842186290">figure 6</a>). You don&#8217;t have to do anything but point and click here.</li>
<li> Finally, go to the <kbd>Default.aspx.cs</kbd> code-behind file and make sure that the Postback saves form data by typing (gasp!) a C# statement (<a title="Default.aspx.cs" href="http://code.google.com/p/glazkov-attic/source/browse/trunk/YourTimesheets/Default.aspx.cs">listing 1</a>). Notice that I also added a self-redirect there to make sure that the page is always rendered as a result of a <kbd>GET</kbd> request. This may seem odd to you, but how many times did you hit Refresh on your browser and saw the woo wee! let&#8217;s repost the data you just entered, again! message? This one-liner prevents that situation.</li>
<li> At this point, you have a fully functional ASP.NET timesheet entry application, but let&#8217;s go ahead and add some styling to it (<a title="Add" href="http://picasaweb.google.com/dimitri.glazkov/NETOnGearsATutorial/photo#5161251682727088194">figure 7</a> and <a title="Default.aspx" href="http://code.google.com/p/glazkov-attic/source/browse/trunk/YourTimesheets/Default.aspx.cs">listing 2</a>).</li>
</ul>
<p>It is probably worth mentioning that no amount of styling will fix some obvious usability problems with the data entry in this particular piece of user interface, but hey, I didn&#8217;t call this article ASP.NET on Gears: A Production-ready Application, right?</p>
<h2>Step 2: Develop Gears Application Concept</h2>
<p>Moving on to Gears stuff. This part of the show contains graphic hand-coding and conceptual thinking that may not be appropriate for those who build their stuff using the Toolbox bar and Design View. People who are allergic to Javascript should ask their doctor before taking this product. Just kidding! You&#8217;ll love it, you&#8217;ll see &#8230; I think.  For this tutorial, I chose to use the <a title="Build" href="http://code.google.com/p/google-gears/downloads/list">0.2.2.0 build</a> of Gears, which is not yet a production build, but from what I heard will be shortly. This build offers a quite a bit more functionality for workers, such as <a title="HttpRequest" href="http://code.google.com/apis/gears/upcoming/api_httprequest.html">HttpRequest</a> and <a title="Timer" href="http://code.google.com/apis/gears/upcoming/api_timer.html">Timer</a> modules, and as you&#8217;ll see shortly, we&#8217;ll need them in this application.  Let&#8217;s first figure out how this thing will work. When connected (online), the application should behave as if Gears weren&#8217;t bolted on: entry submissions go directly to the server. Once the connection is severed (application goes offline), we can use <a title="LocalServer" href="http://code.google.com/apis/gears/upcoming/api_localserver.html">LocalServer</a> to serve application resources so that the page still comes up.  Obviously, at this point we should intercept form submission to prevent the application from performing a <kbd>POST</kbd> request (those are always passed through the LocalServer). As we intercept the submission, we put the submitted data into a <a title="Database" href="http://code.google.com/apis/gears/upcoming/api_database.html">Database</a> table.  Then, when back online, we replay the submissions back to the server asynchronously, using <a title="WorkerPool" href="http://code.google.com/apis/gears/upcoming/api_workerpool.html">WorkerPool</a> and <a title="HttpRequest" href="http://code.google.com/apis/gears/upcoming/api_httprequest.html">HttpRequest</a>, reading from the <a title="Database" href="http://code.google.com/apis/gears/upcoming/api_database.html">Database</a> table.  Speaking of back online, we&#8217;ll need some way to detect the state of the application. We&#8217;ll do this by setting up a <a title="WorkerPool" href="http://code.google.com/apis/gears/upcoming/api_workerpool.html">WorkerPool</a> worker, making periodic <a title="HttpRequest" href="http://code.google.com/apis/gears/upcoming/api_httprequest.html">HttpRequest</a> calls to a URL that&#8217;s not registered with the <a title="LocalServer" href="http://code.google.com/apis/gears/upcoming/api_localserver.html">LocalServer</a>. When request fails, we deem the state to be offline. When request succeeds, we presume that things are online. Simple enough?  To keep our dear user aware of what&#8217;s going on, we&#8217;ll need to do quite a bit of DOM manipulation. No, not that <a title="Dom" href="http://en.wikipedia.org/wiki/Dom_Pérignon_(wine)">Dom</a>. This <a title="W3C" href="http://www.w3.org/DOM/">DOM</a>. For instance, the data, entered offline should be displayed for the user in a separate, clearly labeled table. We will also need to know of events like the user attempting to submit the form, so that we could intercept the submission and stuff it into Database.  Oh, and there&#8217;s one more thing. Since we build this application to operate both offline and online, we can&#8217;t rely on server-based validation. For this task, I chose to write my own client-side validation, but you can try and tinker with the <a title="Validation" href="http://msdn2.microsoft.com/en-us/library/debza5t0.aspx">standard ASP.NET 2.0 validation controls</a> and the crud they inject in your document.  To summarize, we need the following components (let&#8217;s go ahead and name them, because naming things is fun):</p>
<ul>
<li> Database, to write and read entries, entered offline.</li>
<li> DOM, to intercept submits, changes of input values, writing offline entries table, and other things that involve, well, DOM manipulation.</li>
<li> Monitor, to poll server and detect when the application becomes offline and online.</li>
<li> Store, to keep track of the resources that will be handled by LocalServer when application is offline.</li>
<li> Sync, to relay submitted offline data back to the server.</li>
<li> Validator, to ensure that the field data is valid before it&#8217;s submitted, whether online or offline.</li>
</ul>
<h2>Step 3: Define Interfaces</h2>
<p>Piece of cake! The only thing left is writing some code. Perhaps we should start with defining how these pieces of the puzzle will interact. To keep code digestible and easy to hack on (it&#8217;s a tutorial, right?), we will make sure that these interactions are clearly defined. To do that, let&#8217;s agree on a couple of rules:</p>
<ul>
<li> Each component exposes a consistent way to interact with it</li>
<li> A component may not call another component directly</li>
</ul>
<p>It&#8217;s like an old breadboard from your science club tinkering days: each component is embedded into a block of non-conductive resin, with only inputs and outputs exposed. You plug the components into a breadboard and build the product by wiring those inputs and outputs (<a title="Breadboard" href="http://picasaweb.google.com/dimitri.glazkov/NETOnGearsATutorial/photo#5161251648367349778">figure 8</a>).  In our case, since our components are Javascript objects, we&#8217;ll define an input as any Javascript object member, and an output as an <em>onsomethinghappened</em> handler, typical for <a title="Level" href="http://www.quirksmode.org/js/dom0.html">DOM0</a> interfaces. And here we go, starting with the <var>Database</var> object, in the order of the alphabet:</p>
<pre><code>
// encapsulates working with Gears Database module
// model
function Database() {

    // removes all entries from the model
    this.clear = function() {}

    // opens and initializes the model
    // returns : Boolean, true if successful, false otherwise
    this.open = function() {}

    // reads entries and writes them into the supplied writer object
    // the writer object must have three methods:
    // open() -- called before reading begins
    // write(r, i, nextCallback) -- write entry, where:
    // r : Array of entry fields
    // i : Number current entry index (0-based)
    // nextCallback : callback function, which must be called
    // after the entry is written
    // close() -- called after reading has completed
    this.readEntries = function(writer) {}

    // writes new entry
    // params : Array of entry fields (StartDateTime, DurationMins,
    // Project, Billable, Comment, FormData)
    this.writeEntry = function(params) {}
}
</code></pre>
<p>It&#8217;s worth noting that the <var>readEntries</var> method mimics the archetypical <a title="TextWriter" href="http://msdn2.microsoft.com/en-us/library/system.io.textwriter.aspx">Writer</a> and <a title="Managed" href="http://msdn2.microsoft.com/en-us/library/0ka9477y.aspx">asynchronous call</a> patterns from the .NET framework. I hope you&#8217;ll think of them as the familiar faces in this crowd.  The <var>DOM</var> component has the most ins and outs, primarily because, well, we do a lot of things with the browser DOM:</p>
<pre><code>
// encapsulates DOM manipulation and events
// view
function DOM() {

    // called when the browser DOM is ready to be worked with
    this.onready = function() {}

    // called when one of the inputs changes. Sends as parameters:
    // type : String, type of the input
    // value : String, value of the input
    this.oninputchange = function(type, value) {}

    // called when the form is submitted.
    // if it returns Boolean : false, the submission is cancelled
    // submission proceeds, otherwise
    this.onsubmit = function() {}

    // hooks up DOM event handlers
    this.init = function() {}

    // loads (or reloads) entries, entered offline by creating
    // and populating a table just above the regular timesheets table
    // has the same signature as the writer parameter of the
    // Database.readEntries(writer)... because that's what it's being
    // used by
    this.offlineTableWriter = {
    open: function() {},
    write: function(r, i, nextCallback) {},
    close: function() {}
    }

    // provides capability to show an error or info message. Takes:
    // type : String, either 'error' or 'info' to indicate the type of
    // the message
    // text : String, text of the message message
    this.indicate = function(type, text) {}

    // grabs relevant input values from the form inputs
    // returns : Array of parameters, coincidentally in exactly the
    // format that Database.writeEntry needs
    this.collectFieldValues = function() {}

    // returns : String, URL that is set in of the form action attribute
    this.getPostbackUrl = function() {}

    // removes a row from the offline table. Takes:
    // id : String, id of the entry
    this.removeRow = function(id) {}

    // remove the entire offline table
    this.removeOfflineTable = function() {}

    // enable or disable submit. Takes:
    // enable : Boolean, true to enable submit button, false to disable
    this.setSubmitEnabled = function(enable) {}

    // iterate through fields and initialize field values, according to type
    // Takes:
    // action : Function, which is given:
    // type : String, the type of the input
    // and expected to return : String, a good initial value
    this.initFields = function(action) {}
}
</code></pre>
<p><var>Monitor</var> has a rather simple interface: start me and I&#8217;ll tell you when the connection changes:</p>
<pre><code>
// provides connection monitoring
// controller
function Monitor() {

    // triggered when connection changes
    // sends as parameter:
    // online : Boolean, true if connection became available,
    // false if connection is broken
    this.onconnectionchange = function(online) {};

    // starts the monitoring
    this.start = function() {}
}
</code></pre>
<p>Is this a simplicity competition? Because then <var>Store</var> takes the prize:</p>
<pre><code>
// encapsulates dealing with LocalServer
// model
function Store() {

    // opens store and captures application assets if not captured already
    // returns : Boolean, true if LocalServer and ResourceStore
    // instance are successfully created, false otherwise

    this.open = function() {}
    // forces refresh of the ResourceStore
    this.refresh = function() {}
}
</code></pre>
<p>Synchronization algorithm in this tutorial is exceedingly simple, we basically just start it and wait for it to complete. As each entry is uploaded, the Sync component reports it, so that we could adjust our presentation accordingly:</p>
<pre><code>
// synchronizes (in a very primitive way) any entries collected offline
// with the database on the server by replaying form submissions
function Sync() {

    // called when a synchronization error has occured. Sends:
    // message : String, the message of the error
    this.onerror = function(message) {}

    // called when the synchronization is complete.
    this.oncomplete = function() {}

    // called when an entry was uploaded to the server. Sends:
    // id : String, the rowid of the entry
    this.onentryuploaded = function(id) {}

    // starts synchronization. Takes:
    // url : String, the url to which to replay POST requests
    this.start = function(url) {}
}
</code></pre>
<p>Finally, the <var>Validator</var>. It&#8217;s responsible both for providing good initial values for the form, as well as making sure the user is entering something legible.</p>
<pre><code>
// encapsulates validation of values by type
function Validator() {

    // provides good initial value, given a type. Takes:
    // type : String, the type of the input, like 'datetime' or
    // 'number'
    // returns : String, initial value
    this.seedGoodValue = function(type) {}

    // validates a value of a specified type. Takes:
    // type : String, the type of the input.
    // value : String, value to validate
    // returns : Boolean, true if value is valid, false otherwise
    this.isValid = function(type, value) {}
}
</code></pre>
<p>Whew! Are we there yet? Almost.</p>
<h2>Step 4: Write Code</h2>
<p>This is where we pull up our sleeves and get to work. There&#8217;s probably no reason to offer a play-by-play on the actual process of coding, but here are a couple of things worth mentioning:</p>
<ul>
<li> Javascript is a dynamic, loosely-typed language. Enjoy it. Don&#8217;t square yourself into compile-time thinking. This is funk, not philharmonic.</li>
<li> Javascript is single-threaded. The trick that you might have learned with 0-timeout doesn&#8217;t actually start a new thread. It just waits for its opportunity to get back on the main thread.</li>
<li> Gears workers, on the other hand, are truly multi-threaded. There is some pretty neat plumbing under the hood that sorts out this dichotomy by queueing the messages, and you might want to be aware of that when writing the code. For instance, calling main thread with UI operations from a worker doesn&#8217;t make them asynchronous: the message handlers will still line up and wait for their turn. So, if your worker does a lot of waiting on the main thread, you may not see as much benefit from using the worker pools.</li>
<li> Gears currently lack a database or resource store management console with slick user interface (hint: you should perhaps join the project and lend a hand with that). But <a title="Google" href="http://code.google.com/apis/gears/tools.html">dbquery and webcachetool</a> are good enough. For this project, I cooked up asmall pagethat, upon loading, blows away all known state of the application, and that was pretty handy in development (<a title="clean.html" href="http://code.google.com/p/glazkov-attic/source/browse/trunk/YourTimesheets/Tools/clean.html">listing 3</a>).</li>
<li> There is a very simple way to simulate offline state on your local machine. It&#8217;s called <a title="Restarting" href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/003ed2fe-6339-4919-b577-6aa965994a9b.mspx?mfr=true">iisreset</a>. From command line, run <kbd>iisreset /stop</kbd> to stop your Web server and you&#8217;ll have a perfect simulation of a broken connection. Run <kbd>iisreset /start</kbd> to get the application back online.</li>
</ul>
<p>Armed with these Gear-ly pearls of wisdom, you jump fearlessly on the interfaces above and get coding. Or&#8230; you can just see how I&#8217;ve done it (<a title="Scripts" href="http://code.google.com/p/glazkov-attic/source/browse/trunk/YourTimesheets/Scripts/">listing 3</a></p>
<p>).</p>
<h2>Step 5: Feed the Monkey</h2>
<p>Feed the monkey? Wha&#8230; ?! Just wondering if you&#8217;re still paying attention. Technically, we&#8217;re done here. The application is working (to see for yourself, <a title="Screencast" href="http://glazkov-attic.googlecode.com/files/YourTimesheetsInAction.mov">download</a> the screencast or <a title="Screencast" href="http://www.youtube.com/watch?v=YgB8Rku2bHw">watch it all fuzzy</a> on YouTube).  As you may have gleaned from our coding adventure, Google Gears offers opportunities that weren&#8217;t available to front-end developers before: to build Web applications that work offline or with occasionally-available connection, to add real multi-threading to Javascript, and much more. What&#8217;s cool is that Gears are already available on many platforms and browsers (including Internet Explorer), and the list is growing quickly. Perhaps PC World is onto something, calling it <a title="The" href="http://www.pcworld.com/article/id,140663/article.html">the most innovative product of 2007</a>.  But don&#8217;t listen to me: I am a <a title="Call" href="http://glazkov.com/blog/gearhead/">confessed</a> Gearhead. Try it for yourself.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/glazkov.wordpress.com/119/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/glazkov.wordpress.com/119/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/glazkov.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/glazkov.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/glazkov.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/glazkov.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/glazkov.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/glazkov.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/glazkov.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/glazkov.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/glazkov.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/glazkov.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/glazkov.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/glazkov.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/glazkov.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/glazkov.wordpress.com/119/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=glazkov.com&amp;blog=4127402&amp;post=119&amp;subd=glazkov&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://glazkov.com/2008/01/31/gears-asp-net-tutorial/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d561e3aa24ea8e6878e99cd108429329?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dglazkov</media:title>
		</media:content>
	</item>
		<item>
		<title>Back into the Future of Web: HTML5 SQL Player</title>
		<link>http://glazkov.com/2007/11/17/html5-sql-player/</link>
		<comments>http://glazkov.com/2007/11/17/html5-sql-player/#comments</comments>
		<pubDate>Sun, 18 Nov 2007 03:48:00 +0000</pubDate>
		<dc:creator>Dimitri Glazkov</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://glazkov.com/blog/html5-sql-player/</guid>
		<description><![CDATA[Like a Three Stooges carpet-pull slapstick stunt, the HTML5 client-side storage spec changed drastically the night I released my Gears wrapper. Thump. Ow! I am ok! I am ok! And better for it! This time, I am back with the vengeance. Why fight the change? Embrace it! Dear reader, allow me to present the HTML5 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=glazkov.com&amp;blog=4127402&amp;post=162&amp;subd=glazkov&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>
Like a <a href="http://www.threestooges.com/" title="The Official Three Stooges Site">Three Stooges</a> carpet-pull <a href="http://en.wikipedia.org/wiki/Slapstick" title="Slapstick on Wikipedia">slapstick</a> stunt, the HTML5 <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/section-sql.html">client-side storage spec</a> changed drastically the night I released my <a href="http://glazkov.com/blog/html5-gears-wrapper/" title="HTML5 Wrapper for Gears">Gears wrapper</a>. <em>Thump. Ow!</em>
</p>
<p>
I am ok! I am ok! And better for it! This time, I am back with the vengeance. Why fight the change? Embrace it! Dear reader, allow me to present the <a href="http://attic.glazkov.com/player/">HTML5 SQL Player</a>, a tool that spec developers and curious bystanders alike can use to poke and prod the spec <em>in action</em>. Essentially, this is a <a href="http://code.google.com/apis/gears/">Google Gears</a>-based sandbox, in which a user can run Javascript code to query and test the interfaces, implemented by the specification. If I were into that kind of thing, there would be a picture of a crazy-eyed <a href="http://www.imdb.com/name/nm0000502/" title="Christopher Lloyd on IMDB">Christopher Lloyd</a> and some reference to the <a href="http://en.wikipedia.org/wiki/Back_to_the_Future_trilogy" title="Back to The Future Trilogy on Wikipedia">movie</a> that doomed his career. Yes, my friends, this sandbox is a glimpse into the <em>yet-to-be-implemented</em> technology.
</p>
<p>And as such, beware of the bleeding edge. Some things in the spec are somewhat under&#8230; erm&#8230; specified (like the mode of transaction and its effect on sequential calls of the <code>transaction</code> method) and some things in the sandbox are under&#8230; erm&#8230; implemented (like <code>changeVersion</code> or SQL sanitation). But regardless, this approach is still the best if you&#8217;re trying to evaluate spec&#8217;s viability in an effort to make it better. And that&#8217;s what this is all about.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/glazkov.wordpress.com/162/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/glazkov.wordpress.com/162/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/glazkov.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/glazkov.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/glazkov.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/glazkov.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/glazkov.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/glazkov.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/glazkov.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/glazkov.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/glazkov.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/glazkov.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/glazkov.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/glazkov.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/glazkov.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/glazkov.wordpress.com/162/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=glazkov.com&amp;blog=4127402&amp;post=162&amp;subd=glazkov&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://glazkov.com/2007/11/17/html5-sql-player/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d561e3aa24ea8e6878e99cd108429329?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dglazkov</media:title>
		</media:content>
	</item>
		<item>
		<title>Jumping Off Audience Navigation Bandwagon</title>
		<link>http://glazkov.com/2007/11/15/off-audience-navigation/</link>
		<comments>http://glazkov.com/2007/11/15/off-audience-navigation/#comments</comments>
		<pubDate>Thu, 15 Nov 2007 16:12:00 +0000</pubDate>
		<dc:creator>Dimitri Glazkov</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://glazkov.com/blog/off-audience-navigation/</guid>
		<description><![CDATA[Future Endeavor has another insightful post, followed by an interesting UX example of the University of Virginia front door. I am a big fan of this blog and would highly recommend it to anyone involved in higher education Web development. This time, Tony Dunn talks about the future of the University Web site. I like [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=glazkov.com&amp;blog=4127402&amp;post=158&amp;subd=glazkov&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>
<a href="http://futureendeavour.blogspot.com/">Future Endeavor</a> has another insightful post, followed by an interesting UX example of the <a href="http://www.virginia.edu/">University of Virginia</a> front door. I am a big fan of this blog and would highly recommend it to anyone involved in higher education Web development. This time, Tony Dunn talks about the future of the University Web site. I like his thinking and I feel that my thinking is mostly aligned with it. Where we diverge is on the future of the audience-based navigation.
</p>
<p>
The truth is, I no longer believe in the necessity (or usefulness) of the audience-based navigation for a University. There, I said it. Having been the advocate for the last 8 years, I eventually came to realize that all it does is create an extra barrier for the user (umm, who am I? Which is the right door?) and is mostly ignored by the visitors, anyway (I am basing this on my observations and thought experiments).
</p>
<p>
Self-selection is a myth: as you probably know, the user commonly belongs to multiple or none of the offered audiences, and this artificial ritual of forcing the visitor to put the right hat on is not only confusing, it&#8217;s actually a little bit insulting.
</p>
<p>
What&#8217;s the alternative? Concentrate on three things:
</p>
<ul>
<li>Needs-based Clusters. Envelop topics, relevant to specific needs (<q>How do I become a student?</q>) into a cohesive (spit-and-polished!) and limited in scope sites.</li>
<li>Lifeline Links. Identify 3-5 most desperate and immediate needs of your visitor (<q>I have to check my grades</q>) and by golly, put them on the home page.</li>
<li>Ambient Findability. Make sure that each page on your site carries a potential of getting the user closer to achieving their goals.</li>
</ul>
<p>
That&#8217;s all for now. I am eager to hear your thoughts and opinions on my little turn-about.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/glazkov.wordpress.com/158/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/glazkov.wordpress.com/158/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/glazkov.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/glazkov.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/glazkov.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/glazkov.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/glazkov.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/glazkov.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/glazkov.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/glazkov.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/glazkov.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/glazkov.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/glazkov.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/glazkov.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/glazkov.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/glazkov.wordpress.com/158/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=glazkov.com&amp;blog=4127402&amp;post=158&amp;subd=glazkov&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://glazkov.com/2007/11/15/off-audience-navigation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d561e3aa24ea8e6878e99cd108429329?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dglazkov</media:title>
		</media:content>
	</item>
		<item>
		<title>Chewing on Open Social</title>
		<link>http://glazkov.com/2007/11/04/chewing-on-open-social/</link>
		<comments>http://glazkov.com/2007/11/04/chewing-on-open-social/#comments</comments>
		<pubDate>Mon, 05 Nov 2007 00:52:00 +0000</pubDate>
		<dc:creator>Dimitri Glazkov</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://glazkov.com/blog/chewing-on-open-social/</guid>
		<description><![CDATA[So, the cat is out of the bag, in case you haven&#8217;t heard (and if you haven&#8217;t, what remote island are you living on?). I spent a bit of time this weekend, playing with the new toys, trying to analyze by immersion. Essentially, on the Javascript side, it&#8217;s one part existing Gadget API, one part [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=glazkov.com&amp;blog=4127402&amp;post=159&amp;subd=glazkov&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>
So, the <a title="Google OpenSocial API" href="http://code.google.com/apis/opensocial/">cat is out of the bag</a>, in case you haven&#8217;t heard (and if you haven&#8217;t, what remote island are you living on?). I spent a bit of time this weekend, playing with the new toys, trying to analyze by immersion. Essentially, on the Javascript side, it&#8217;s one part existing <a title="Gadget API on Google Code" href="http://code.google.com/apis/gadgets/">Gadget API</a>, one part new feature (you guessed it, named <a title="Importing the OpenSocial Library" href="http://code.google.com/apis/opensocial/docs/javascript/index.html#Importing">opensocial</a>), and you&#8217;ve got yourself a whole new playing field to tinker with. Not being familiar with the Gadget API, I was learning both parts at the same time, which is never a bad thing.
</p>
<p>
After getting my <a title="Orkut Sandbox sign-up" href="http://code.google.com/support/opensocialsignup/">sandbox permit</a>, I hastily cooked up two simple gadgets, er.. social applications, the <a title="Twitter" href="http://estradacms.com/opensocial/twitter.xml">Twitter</a> and the <a title="OpenZombie" href="http://estradacms.com/opensocial/open-zombie.xml">OpenZombie</a>. Both of these are skeletal proofs-of-concept, on whose I have no intention to continue development. So, feel free to borrow in parts or in whole &#8212; it&#8217;s <a title="Creative Commons Public Domain License" href="http://creativecommons.org/licenses/publicdomain/">public domain</a>, baby! I intentionally tried to keep them light-weight, client-side-only. Both have been casually tested with Firefox and IE7. In other words, don&#8217;t call me if you have a problem running either.
</p>
<p>
First application grabs data from Twitter using Gadget API calls and renders it to somewhat resemble a Twitter feed. It doesn&#8217;t actually use any of the OpenSocial API functionality and can be run in the iGoogle. It does use the <a title="User Preferences" href="http://code.google.com/apis/gadgets/docs/reference.html#Userprefs_Ref">UserPrefs</a> to ask for the Twitter username, and Orkut&#8217;s current way of dealing with this is rather jarring, so be prepared for that.
</p>
<p>
Second one is my 45-minute take on the ever-ridiculous <a title="Zombies Application on Facebook" href="http://www.facebook.com/apps/application.php?id=2341504841&amp;b">Zombies</a> application on Facebook. Except this one actually bites automatically. As soon as the user stumbles upon my profile page, they are bitten by the OpenZombie application (with the corresponding activity stream message), and offered to install the application themselves as a vengeance-laden consolation prize. No stats are kept (and that would be hard, given that API doesn&#8217;t yet allow you to update owner&#8217;s person data), and no blood-curdling imagery is displayed. I figured, the next guy will come along and make it pretty. And by <q>pretty</q> I mean <q>despicably horrific</q>.
</p>
<p>
Speaking of the next guy, here are a couple of tips that I have for you:
</p>
<ul>
<li>When debugging the application, appending <code>&amp;bpc=1</code> to the URL of the page itself will disable caching of the application. Someone <a title="Orkut Sandbox - Permanent No Cache" href="http://www.tricks4fun.com/orkut-sandbox-permanent-no-cache/">already built</a> a Greasemonkey script for that.</li>
<li>Modularize your development. Make your application a harness that calls scripts and styles remotely:</li>
<pre>&lt;Module&gt;
	&lt;ModulePrefs [attributes go here]&gt;
		&lt;Require feature="opensocial-0.5"/&gt;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  [more feature requirements go here]
	&lt;/ModulePrefs&gt;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;  [user prefs, etc. go here]
	&lt;Content type="html"&gt;
	&lt;![CDATA[
		&lt;script type='text/javascript'
			src='[absolute script url]'&gt;&lt;/script&gt;
		&lt;style&gt;
			@import url('[absolute style url');
		&lt;/style&gt;
		&lt;div id="message"&gt;&lt;/div&gt;
		&lt;div id="panel"&gt;&lt;/div&gt;
 	]]&gt;
  &lt;/Content&gt;
&lt;/Module&gt;
</pre>
<p>
Then, in your script, do something like this:
</p>
<pre>
_IG_RegisterOnloadHandler(function() {
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // your code goes here
});
</pre>
<li>Once you have modularized your application, you can do another simple trick: edit your <a title="hosts" href="http://en.wikipedia.org/wiki/Hosts_file">hosts</a> file to temporarily point the hostname in the script and style URLs to <a title="localhost" href="http://en.wikipedia.org/wiki/Localhost">localhost</a>. Then make sure that these files are accessible from your local web server. Now you can edit them and see the changes without having to push the files to the server on which the application will eventually be hosted. Just don&#8217;t forget to remove the edits in the hosts file when you&#8217;re done developing.</li>
</ul>
<p>
Now, for a quick technology review of the OpenSocial Javascript API (can&#8217;t speak for the GData stuff, haven&#8217;t played with it). On the contrary to the few <a title="Dave Winer's Reaction" href="http://www.scripting.com/2007/11/03.html">negative</a> <a title="Dare Obasanjo's Technical Overview" href="http://www.25hoursaday.com/weblog/2007/11/03/GoogleOpenSocialTechnicalOverviewAndCritique.aspx">reactions</a> in the blogosphere, I find OpenSocial pretty impressive. I think the API is easy to learn and follow, the transparent authentication and identity data management model is neat, and there&#8217;s plenty of room to play, or even build something useful. Bringing application development into the Javascript domain is a <em>good thing</em>. Yeah, the sandbox squeaks and rattles, but that&#8217;s typical for an early release. Give it a little time.
</p>
<p>
The API itself is wordy and a bit inelegant, though this may be a viewpoint,<br />
skewed by the laconic beauty of <a title="JQuery Javascript Framework" href="http://jquery.com">JQuery</a>. I am guessing that its current shape is probably a result of being tailored toward the more arcane Javascript<br />
implementations. I can&#8217;t find any other explanation for the gratuitous global<br />
namespace pollution or things like API objects having accessible underscored methods/fields.
</p>
<p>
But my biggest beef is with the Gadget API. With it&#8217;s <q>let&#8217;s start now, it&#8217;s so simple!</q> approach, it practically encourages hacky, spaghetti-style Web development. Adding even a primitive asset management to the XML declaration would be a win-win: developers are nudged to separate behavior, presentation, and markup, and the server gets to know in advance what&#8217;s needed to render a gadget, thus providing opportunities for caching, embedding, or aggregating the assets:
</p>
<pre>
&lt;Assets&gt;
&nbsp;&nbsp;&nbsp; &lt;Asset Type="js" Src="http://example.com/twitter.js" /&gt;
&nbsp;&nbsp;&nbsp; &lt;Asset Type="css"&nbsp; Src="http://example.com/twitter.css" /&gt;
...
</pre>
<p>
Another thing that stood out is the lack of user experience management. Facebook went a long way (they invented their own language!) to keep the consistency of the user interface by offering common primitives, like <a title="profile-action" href="http://wiki.developers.facebook.com/index.php/Fb:profile-action">profile action</a> or the freshly baked <a title="board" href="http://wiki.developers.facebook.com/index.php/Fb:board">board</a>. Walking from application to application, you can easily see where the primitives end and developer&#8217;s own creative aspirations begin (and believe me, in 8 cases out of 10, it ain&#8217;t pretty). But at least they tried. The only thing that Gadget API has in this regard is handling of user preferences. That&#8217;s it. The containing IFRAME is essentially an open canvas. This is something that has to be addressed, especially considering that <a title="Ning" href="http://www.ning.com/">some partners</a> in the alliance are pretty good about keeping their UX noses clean.
</p>
<p>
I hesitate to draw any sort of conclusions in regard to direction or<br />
viability of the project. Obviously, this is a very early developer&#8217;s<br />
preview, where it&#8217;s perfectly acceptable to come across matchsticks and<br />
duct tape. As it stands right now, OpenSocial is certainly not as<br />
well-oriented and focused as Facebook, and Orkut doesn&#8217;t make a good sandbox<br />
container, because&#8230; well, let&#8217;s just say it won&#8217;t win any usability<br />
awards. And certainly not visual design awards. Even with that, I can<br />
see fairly clearly what Google wants to become: they want to be the social networking plumbing. Just like their search became the <q>the Internet</q><br />
for many users, I can speculate that Google hopes to offer free,<br />
ubiquitous, and highly mashable pieces of infrastructure that power the<br />
majority of person and community-centric software on the Web. Ultimately, I don&#8217;t believe<br />
it&#8217;s a <a title="Your Move, Facebook on TechCrunch" href="http://www.techcrunch.com/2007/11/01/facebook-your-move/">move in a game of chess</a>, but a tiny step in the strategy that reaches much<br />
farther and wider than everyone&#8217;s favorite blue-shaded time waster.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/glazkov.wordpress.com/159/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/glazkov.wordpress.com/159/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/glazkov.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/glazkov.wordpress.com/159/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/glazkov.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/glazkov.wordpress.com/159/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/glazkov.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/glazkov.wordpress.com/159/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/glazkov.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/glazkov.wordpress.com/159/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/glazkov.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/glazkov.wordpress.com/159/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/glazkov.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/glazkov.wordpress.com/159/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/glazkov.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/glazkov.wordpress.com/159/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=glazkov.com&amp;blog=4127402&amp;post=159&amp;subd=glazkov&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://glazkov.com/2007/11/04/chewing-on-open-social/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d561e3aa24ea8e6878e99cd108429329?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dglazkov</media:title>
		</media:content>
	</item>
		<item>
		<title>Slides from my IPSA presentation on HTML5 and Google Gears</title>
		<link>http://glazkov.com/2007/11/01/html5-gears-p10n/</link>
		<comments>http://glazkov.com/2007/11/01/html5-gears-p10n/#comments</comments>
		<pubDate>Thu, 01 Nov 2007 19:43:00 +0000</pubDate>
		<dc:creator>Dimitri Glazkov</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://glazkov.com/blog/html5-gears-p10n/</guid>
		<description><![CDATA[Today, at the monthly IPSA meeting, I gave a presentation on Google Gears and HTML5 client-side storage part of the spec. As promised, I uploaded the slides to this blog. &#8230; Yes, I am going slide-less from now on. Jeff Keeton and I have already done a couple of browser tabs-only presentations before, and the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=glazkov.com&amp;blog=4127402&amp;post=157&amp;subd=glazkov&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today, at the monthly <a href="http://ipsaonline.org/"><abbr title="Internet Professionals Society of Alabama">IPSA</abbr></a> meeting, I gave a presentation on Google Gears and HTML5 client-side storage part of the spec. As promised, I uploaded <a title="Presentation Slides" href="http://glazkov.com/resources/files/html5-gears-p10n.zip">the slides</a> to this blog.
</p>
<p>
&hellip; Yes, I am going slide-less from now on. <a rel="friend met colleague" href="http://blog.gobyfastphotos.com/"><abbr title="Jeff Keeton">Jeff Keeton</abbr></a> and I have already done a couple of browser tabs-only presentations before, and the simple method works as well or better than the slides.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/glazkov.wordpress.com/157/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/glazkov.wordpress.com/157/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/glazkov.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/glazkov.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/glazkov.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/glazkov.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/glazkov.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/glazkov.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/glazkov.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/glazkov.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/glazkov.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/glazkov.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/glazkov.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/glazkov.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/glazkov.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/glazkov.wordpress.com/157/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=glazkov.com&amp;blog=4127402&amp;post=157&amp;subd=glazkov&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://glazkov.com/2007/11/01/html5-gears-p10n/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d561e3aa24ea8e6878e99cd108429329?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dglazkov</media:title>
		</media:content>
	</item>
		<item>
		<title>HTML5 Wrapper for Gears</title>
		<link>http://glazkov.com/2007/10/22/html5-gears-wrapper/</link>
		<comments>http://glazkov.com/2007/10/22/html5-gears-wrapper/#comments</comments>
		<pubDate>Tue, 23 Oct 2007 02:12:00 +0000</pubDate>
		<dc:creator>Dimitri Glazkov</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://glazkov.com/blog/html5-gears-wrapper/</guid>
		<description><![CDATA[This is possibly the lowest-hanging fruit ever. After WebKit folks released their implementation of the HTML5 SQL storage specification, Gears immediately became the odd man out, the non-standards-compliant implementation. Never you mind that this part of the spec is still basically a twinkle in Hixie&#8216;s eye. By adding the SQL bit into the latest WebKit [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=glazkov.com&amp;blog=4127402&amp;post=156&amp;subd=glazkov&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>
This is possibly the lowest-hanging fruit ever. After WebKit folks <a title="WebKit Does HTML5 Client-side Database Storage" href="http://webkit.org/blog/126/webkit-does-html5-client-side-database-storage/">released</a> their implementation of the HTML5 <a title="4.11 Client-side database storage" href="http://www.whatwg.org/specs/web-apps/current-work/#sql">SQL storage</a> specification, <a title="Google Gears" href="http://code.google.com/apis/gears/">Gears</a> immediately became the odd man out, the non-standards-compliant implementation. Never you mind that this part of the spec is still basically a twinkle in <a title="Hixie's Natural Log" href="http://ln.hixie.ch/">Hixie</a>&#8216;s eye. By adding the SQL bit into the latest WebKit <a title="WebKit Nightly Builds" href="http://nightly.webkit.org/">nightlies</a> (Windows users are still <a title="Mark Rowe's Comment" href="http://webkit.org/blog/126/webkit-does-html5-client-side-database-storage/#comment-22984">blissfully unaware</a> of this, by the way), the legendary Apple team put a symbolic stake into the metaphoric ground: this better not be moving anywhere.
</p>
<p>
So I thought, why not connect the dots? Gears is a capable and much more mature implementation, both WebKit and Gears use the same SQLite server, so it should be just a matter of writing a simple wrapper to bring Gears back into the standards fold.
</p>
<p>
So here they are, WebKit&#8217;s Stickies <a title="WebKit HTML 5 SQL Storage Notes Demo" href="http://glazkov.com/resources/files/webkit-stickies.html">running</a> in Firefox with Gears, using a <a title="New Gears Initialization Script" href="http://glazkov.com/resources/files/new_gears_init.js">tiny bridge script</a> I wrote (see <a title="Flickr Screenshot" href="http://flickr.com/photos/dglazkov/1700746926/">the screenshot</a> on Flickr if you aren&#8217;t inclined to install Gears). If you&#8217;re running Firefox 3, you may actually be able to write on those stickies. For Firefox 2 users, the lack of <a title="Bug 237964" href="https://bugzilla.mozilla.org/show_bug.cgi?id=237964">contenteditable</a> support means that you can just create, move, and delete the notes. IE users are <a title="Sol on Wikipedia" href="http://en.wikipedia.org/wiki/Sol_%28disambiguation%29">SOL</a>&#8216;d, because the Stickies sample uses DOM Level 2 events and other happy standards goodies. Do not let this stop you from using the bridge itself, though: it works in IE just peachy-fine.
</p>
<p>
The script, as I mentioned before, is laughably small and oh yes, incomplete. But I figured, the <var>openDatabase</var> and <var>executeSql</var> support take you about 80% of the way for most Web application development needs, and should the need for the other 20% arise, I would gladly oblige and be your code monkey.
</p>
<p>
Gearites and Safaritans, if you feel like I encroached on any of your wonderful work by creating this frankenstein, please let me know and we&#8217;ll sort this out.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/glazkov.wordpress.com/156/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/glazkov.wordpress.com/156/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/glazkov.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/glazkov.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/glazkov.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/glazkov.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/glazkov.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/glazkov.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/glazkov.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/glazkov.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/glazkov.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/glazkov.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/glazkov.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/glazkov.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/glazkov.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/glazkov.wordpress.com/156/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=glazkov.com&amp;blog=4127402&amp;post=156&amp;subd=glazkov&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://glazkov.com/2007/10/22/html5-gears-wrapper/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d561e3aa24ea8e6878e99cd108429329?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dglazkov</media:title>
		</media:content>
	</item>
		<item>
		<title>My iPhone SDK</title>
		<link>http://glazkov.com/2007/10/17/my-iphone-sdk/</link>
		<comments>http://glazkov.com/2007/10/17/my-iphone-sdk/#comments</comments>
		<pubDate>Thu, 18 Oct 2007 01:14:00 +0000</pubDate>
		<dc:creator>Dimitri Glazkov</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://glazkov.com/blog/my-iphone-sdk/</guid>
		<description><![CDATA[So, my good friend Steve spills the beans about the upcoming SDK. The crowd screams like girls at the Beatles concert. Even ever-curmudgeonly Dave eeks a &#8220;hooray&#8221;. And that&#8217;s a big deal, my reading acquaintance. Now, I don&#8217;t own an iPhone, but I play with one at the local store every other week. And I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=glazkov.com&amp;blog=4127402&amp;post=164&amp;subd=glazkov&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>
So, my good friend Steve <a href="http://www.apple.com/hotnews/" title="Third Party Applications on the iPhone">spills the beans</a> about the upcoming SDK. The crowd <a href="http://gizmodo.com/gadgets/apple/steve-jobs-iphone-sdk-in-dev-hands-february-08-311881.php" title="Gizmodo">screams</a> <a href="http://www.9to5mac.com/node/269" title="9to5mac">like</a> <a href="http://www.techmeme.com/071017/p57#a071017p57" title="Techmeme">girls</a> at the Beatles concert. Even ever-curmudgeonly <abbr title="Dave Winer">Dave</abbr> <a href="http://www.scripting.com/stories/2007/10/17/iphoneSdkComingInFeb.html" title="Scripting News">eeks</a> a &#8220;hooray&#8221;. And that&#8217;s a big deal, my reading acquaintance. Now, I don&#8217;t own an iPhone, but I play with one at the local store every other week. And I also am a <a href="http://glazkov.com/blog/gearhead/" title="Call Me Gearhead">gearhead</a>, as we&#8217;ve discussed before. And, I watch <a href="http://groups.google.com/group/google-gears/" title="Google Gears Discussion Group">google-gears</a> and<br />
<a href="http://www.whatwg.org/mailing-list" title="WHATWG Mailing Lists">WHATWG</a> groups like a hawk whenever there&#8217;s talk about gear-related stuff.
</p>
<p>
With all that, it is only logical to assume that I am siding <a href="http://factoryjoe.com/blog/2007/10/17/did-the-web-fail-the-iphone/" title="Chris Messina">with Chris</a> on the mournful thoughts for the Web-based application development on the delectable slice of glass-sided aluminum. Because in my opinion, Safari 3 is only five tiny steps away from being a full-fledged application platform.
</p>
<p>
These steps are:
</p>
<ul>
<li>Support of <a href="http://www.whatwg.org/specs/web-apps/current-work/#offline" title="4.6 Offline Web Applications">offline storage</a> and state detection per HTML5 spec</li>
<li><a href="http://www.whatwg.org/specs/web-apps/current-work/#sql" title="4.11 Client-side database storage">Client-side database</a> storage support per HTML5 spec</li>
<li><a href="http://code.google.com/apis/gears/upcoming/api_workerpool.html" title="Google Gears 0.2 WorkerPool Module ">Threading/Worker model</a> from Gears</li>
<li><a href="http://wiki.mozilla.org/WebRunner" title="WebRunner on Mozilla Wiki">WebRunner</a><br />
    -like chromeless launch support</li>
<li><a href="http://groups.google.com/group/google-gears-eng/browse_thread/thread/bb741736c1e3aa7f/9786e87b4cb2f036#9786e87b4cb2f036" title="Proposed API for app install">App install</a> feature as recently proposed on <a href="http://groups.google.com/group/google-gears-eng/" title="google-gears-eng">Gears  Engineers Group</a></li>
</ul>
<p>
The &#8220;nice-to-haves&#8221; and &#8220;coming-soons&#8221; may include direct TCP Network connections, history and browsing context management, and other neat things from the HTML5 spec, but those first five is what could really make the Web applications first-class. Think about it.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/glazkov.wordpress.com/164/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/glazkov.wordpress.com/164/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/glazkov.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/glazkov.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/glazkov.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/glazkov.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/glazkov.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/glazkov.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/glazkov.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/glazkov.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/glazkov.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/glazkov.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/glazkov.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/glazkov.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/glazkov.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/glazkov.wordpress.com/164/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=glazkov.com&amp;blog=4127402&amp;post=164&amp;subd=glazkov&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://glazkov.com/2007/10/17/my-iphone-sdk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d561e3aa24ea8e6878e99cd108429329?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dglazkov</media:title>
		</media:content>
	</item>
		<item>
		<title>HighEdWebDev 2007</title>
		<link>http://glazkov.com/2007/10/13/highedwebdev-2007/</link>
		<comments>http://glazkov.com/2007/10/13/highedwebdev-2007/#comments</comments>
		<pubDate>Sat, 13 Oct 2007 17:12:00 +0000</pubDate>
		<dc:creator>Dimitri Glazkov</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://glazkov.com/blog/highedwebdev-2007/</guid>
		<description><![CDATA[The HighEdWebDev 2007 conference begins tomorrow and I am all ready to go. This is my second year to attend this gathering. Last year, I was sitting at the vendor table (Hello, I would you like to buy a pound of CMS?), guest-blogging at Collegewebeditor.com, and that&#8217;s about it. This year, I (thankfully!) will not [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=glazkov.com&amp;blog=4127402&amp;post=163&amp;subd=glazkov&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>
The <a href="http://highedwebdev.org/2007/">HighEdWebDev 2007</a> conference begins tomorrow and I am all ready to go. This is my second year to attend this gathering. <a href="http://flickr.com/photos/tags/highedwebdev2006/">Last year</a>, I was sitting at <a href="http://flickr.com/photos/dglazkov/280279325/in/set-72157594346530965/">the vendor table</a> (<q>Hello, I would you like to buy a pound of CMS?</q>), guest-blogging at <a href="http://collegewebeditor.com/">Collegewebeditor.com</a>, and that&#8217;s about it. This year, I (thankfully!) will not be vending software<br />
goods, but I did sign up for guest-blogging. In addition, <a href="http://blog.gobyfastphotos.com/">Jeff<br />
Keeton</a> and I will have a post-conference <a href="http://highedwebdev.org/2007/program/workshops_details.html#post1">Workshop 2.0</a>, a boundary-busting, mashpit-flavored jam session of collaborative learning.
</p>
<p>
We&#8217;ll start with breaking down the what&#8217;s, the who&#8217;s, and the why&#8217;s of the gnarly beast we all lovingly call <a href="http://en.wikipedia.org/wiki/Web_2">Web 2.0</a>. We&#8217;ll talk about the traits and the hype, the comers and the goners, but please pelt us with rotten iPhones if we spend more than 20 minutes doing that.
</p>
<p>
Next, we&#8217;ll conduct an exclusive virtual (hold your fingers crossed for Skype) expert panel, discussing what the future holds in store for the Web of tomorrow. The panel will feature several gurus and senseis of the Web, including our own, battle-tested <a href="http://markagreenfield.com/">Mark<br />
Greenfield</a> and Web 2.0&#8242;s uncle Chris <q><a href="http://factoryjoe.com blog/">FactoryJoe</a></q> Messina. We tried to get <a href="http://twitter.com/timoreilly" title="Tim O'Reilly">Father Tim</a>, but Twitter was down at the time.
</p>
<p>
In another 20 minutes, we&#8217;ll pull the plug on the <a href="https://skypecasts.skype.com/skypecasts/home">Skypecast</a>, claiming technical difficulties, and get to the most exciting part of the shop:<br />
the hands-on. In the remaining 2 hours, we will venture to build a new site. <em>Together</em>. Not to compete with the <a href="http://highedwebdev.org/2007/program/workshops_details.html#post2" id="qhx9" title="Advanced CSS Workshop">CSS experts next door</a>, we&#8217;ll skip the part of finding fun rendering bugs in IE, but rest assured, we&#8217;ll follow the process from start to finish. Please bring<br />
your smocks &#8212; this is going to get messy.
</p>
<p>
Armed with our shockingly brilliant collective intelligence, our Team 2.0 will pick the site project, brainstorm goals, audiences, creative concept, <a href="http://flickr.com/photos/dglazkov/sets/72157602230867618/" title="Whiteboarding Photoset on Flickr">doodle wireframes</a> and even say words like <q>AJAX</q> and <q>Controlled Vocabulary</q>. Together, we&#8217;ll argue about pros and cons of promotion techniques, mull over minute details of information architecture, decide on underlying technology and discuss details of implementation while the Photoshop geeks in the corner will<br />
be quietly cooking rounded corners, gradients and drop-shadows.
</p>
<p>
Throughout, we&#8217;ll use social networking tools to facilitate the architecture, development, and promotion of the site, making sure to squeeze the most utility out of the Web 2.0 hype. We probably won&#8217;t walk away with a real site. But we sure will try. And in the process, we&#8217;ll capture and cherish the spirit of<br />
working together and having a good time.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/glazkov.wordpress.com/163/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/glazkov.wordpress.com/163/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/glazkov.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/glazkov.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/glazkov.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/glazkov.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/glazkov.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/glazkov.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/glazkov.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/glazkov.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/glazkov.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/glazkov.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/glazkov.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/glazkov.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/glazkov.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/glazkov.wordpress.com/163/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=glazkov.com&amp;blog=4127402&amp;post=163&amp;subd=glazkov&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://glazkov.com/2007/10/13/highedwebdev-2007/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d561e3aa24ea8e6878e99cd108429329?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dglazkov</media:title>
		</media:content>
	</item>
		<item>
		<title>Call Me Gearhead</title>
		<link>http://glazkov.com/2007/10/07/gearhead/</link>
		<comments>http://glazkov.com/2007/10/07/gearhead/#comments</comments>
		<pubDate>Mon, 08 Oct 2007 00:30:00 +0000</pubDate>
		<dc:creator>Dimitri Glazkov</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://glazkov.com/blog/gearhead/</guid>
		<description><![CDATA[So, I am playing with Google Gears and I&#8217;ve got to tell ya, Gears are brilliant. And the farther you look, the shinier it gets. Why? Because Gears fulfill the ultimate fantasy of any Web developer in a very radical way: they cut into the browser (IE and Firefox, currently), deep and wide, introducing themselves [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=glazkov.com&amp;blog=4127402&amp;post=160&amp;subd=glazkov&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So, I am playing with Google Gears and I&#8217;ve got to tell ya, Gears are brilliant.<br />
And the<br />
<a href="http://code.google.com/p/google-gears/wiki/NewWorkerPoolFeatures">farther</a><br />
you<br />
<a href="http://code.google.com/p/google-gears/wiki/MessagingAPI">look</a>,<br />
the<br />
<a href="http://code.google.com/p/google-gears/wiki/ChannelAPI">shinier</a><br />
it<br />
<a href="http://code.google.com/p/google-gears/issues/detail?id=105&amp;sort=-version&amp;colspec=Version%20Owner%20ID%20Summary%20Component">gets</a>.<br />
Why? Because Gears fulfill the ultimate fantasy of any Web developer in a very<br />
radical way: they cut into the browser (IE and Firefox, currently), deep and<br />
wide, introducing themselves inconspicuously as a DOM facility<br />
(google.gears.factory &#8211; hah, clever fellers, aren&#8217;t they?). And they bring&hellip;<br />
well, I think they bring a bit more clarity into this whole murky future Web<br />
thing. Oh noes, did Dimitri finally cross the line from a grouchy nerd to the<br />
full-blown pundit and started predicting the future? Well, let&#8217;s hope not. To<br />
the very least, color me intrigued.
</p>
<p>
If you&#8217;re not familiar with Gears, this blog is probably not the place to learn<br />
it, but basically, it breaks down to three things: local storage<br />
management, isolation/threading model, and cross-origin data and resource<br />
access. Yeah, see? It&#8217;s not even the same breakdown as<br />
<a href="http://code.google.com/apis/gears/">on<br />
their site</a>. But that&#8217;s why it&#8217;s here on my blog: I can skim over the details<br />
and get to the good stuff. And good stuff it is. I am surprised that the<br />
reaction to Gears is so muted, because they attack the status quo of Web<br />
application (heck, <em>any</em> Web site) development with a deft balestra that<br />
rivals pretty much anything I&#8217;ve seen on the market since, well, since<br />
XMLHttpRequest (only took 5 years to &laquo;discover&raquo; that one, eh?). Here are just a<br />
couple of exciting possibilities that come to mind after playing with the<br />
0.2 code.
</p>
<h3>
  Client-side Composition<br />
</h3>
<p>
Up until now, whether we are eager to admit it or not, DHTML applications (and I<br />
am intentionally classifying<br />
<a href="http://silverlight.net/" title="Silverlight">Silver</a><a href="http://en.wikipedia.org/wiki/Adobe_Flash" title="Flash">Flash</a><br />
out of the picture here) had this distinct flavor of a dumb terminal<br />
(<a href="http://www.crockford.com/" title="Douglas Crockford">Crockford</a><br />
<a href="http://video.google.com/videoplay?docid=452089494323007214&amp;hl=en" title="Gears and The Mashup Problem">says</a><br />
<a href="http://en.wikipedia.org/wiki/IBM_3270" title="IBM 3270">3270</a><br />
&mdash; it&#8217;s catchy. Besides, I still have a 3812 in my basement. Makes<br />
excellent ballast). The server had to pretty much &ldquo;print&rdquo; down the wire the<br />
entire snapshot of a page in a tasty soup of HTML. And that&#8217;s on every request.
</p>
<p>
Google pushed the envelope on client-side composition with GMail and some people<br />
took notice, but by and large, server-side composition reigns supreme. Come to a<br />
page on the Web, and for each ounce of content there is a bucket of context:<br />
navigation, branding elements, context-sensitive link lists, spotlights,<br />
testimonials, you name it &mdash; all repeating from page to page, racking up<br />
bandwidth, using up server cycles needed for complex frameworks to sift, sort,<br />
transform and align resources into the darned HTML snapshot. <em>And that&#8217;s on<br />
every request</em>, my teary-eyed readers. I would join you in your sorrow for<br />
all this wasted energy, but I must finish this song&hellip; er, post.
</p>
<p>
See, with server-side composition, it is up to the server to determine the<br />
context of the requested page and generate markup that puts those links and<br />
other context elements together with the content of the page. Let&#8217;s isolate this<br />
effort into a separate functional component, and call it the context<br />
engine. To summarize, content engine retrieves content of the page, context<br />
engine evaluates content and mashes it with whatever seems relevant, and hands<br />
it off to be served to the user agent. Funny fact: most modern content<br />
management systems are in fact <em>context</em> management systems. Content engine<br />
is dumb and simple (fetch a page, duh). Context engine is complex, nontrivial,<br />
and a gargantuan resource hog.
</p>
<p>
With Gears, you can finally have proper client-side storage (not the<br />
cookie-based monster), and thus you can have proper client-side state. And thus<br />
you can implement proper client-side composition. Which means that aside from<br />
the obvious &#8220;offlining&#8221; of frequently-used, but rarely-changed assets<br />
(static pages, scripts, images, stylesheets) using<br />
<a>LocalServer</a>,<br />
you can actually move the context engine to the client-side&hellip; <em>Hey buddy, an<br />
example wouldn&#8217;t hurt, m&#8217;kay?</em> M&#8217;kay.
</p>
<p>
Let&#8217;s suppose that on your site, most pages have a sidebar, displaying the list<br />
of upcoming events, relevant to this page. With server-side context page, each<br />
page arrives as the blob of markup, generated by the context engine. With<br />
client-side context engine, the page only contains:
</p>
<ul>
<li>
      content and optionally, a list of keywords (tags) that describe the<br />
      meaning of content
    </li>
<li>
      URL to the event feed
    </li>
</ul>
<p>
Upon loading of the page, the client-side context engine kicks in:
</p>
<ol>
<li>
    It checks to see if local event repository exists, and if it doesn&#8217;t,<br />
    creates one by fetching all events from the provided event feed URL.
  </li>
<li>
    It evaluates content/tags against local content repository of events and<br />
    adds relevant event to the sidebar
  </li>
<li>
    Makes &#8220;get added/updated since&#8221; requests to the event feed and updates<br />
    content repository, as well as the sidebar
  </li>
<li>
    Removes older events from the repository
  </li>
</ol>
<p>When this user goes to the next page, the server doesn&#8217;t do anything but serve<br />
content. For the duration of the session (or perhaps some pre-defined interval),<br />
the client-side context engine provides relevant events from its local<br />
repository. The happy, unburdened server sends sloppy kisses to Gears. No<br />
wonder, because now, the only task that requires any meaningful computation is<br />
serving the list of events added or changed since specified date or revision<br />
marker.<br />
<a href="http://twitter.com/help/aboutus" title="Twitter Team">Twitter<br />
boys</a>, this one&#8217;s for you.
</p>
<p>
Decoupling context engine from the server not only makes server&#8217;s work easier.<br />
It also makes context engine server-independent. Who says that I should only<br />
pull events from this one server? Why not pull them from that popular news<br />
outlet, online local events site, or Google calendar?<br />
<a href="http://www.noggin.com/games/upsidedown/" title="The Upside Down Show Online Game">Schmancy-Schmashups</a>,<br />
here we come!
</p>
<p>
Even cooler, the client-side context engine is far better suited to keep the<br />
track of user browsing habits, generating personal taxonomy or tag cloud, and<br />
taking it into the account when evaluating relevancy. Am I the only one who gets<br />
goosebumps thinking about the opportunities?
</p>
<h3>
  Worker as Service<br />
</h3>
<p>
While playing with Gears&#8217;<br />
<a href="http://code.google.com/apis/gears/upcoming/" title="Gears 0.2 Release">0.2</a><br />
bits, I realized that cross-origin<br />
<a href="http://code.google.com/apis/gears/upcoming/api_httprequest.html">HttpRequest</a><br />
and<br />
<a href="http://code.google.com/apis/gears/upcoming/api_workerpool.html#createworkerfromurl">createWorkerFromUrl()</a><br />
introduce a better, more modular <em>and</em> more secure way of building public<br />
JavaScript APIs. In this new release of Gears (developer-only, for now), the<br />
worker can be loaded from a URL, and this URL does not have to originate on the<br />
same server as the document, in which the worker is created. In essence, you can<br />
load and run a script from another server in a completely isolated context,<br />
<em>and</em> you can exchange messages with this script. <em>And</em> this script<br />
can make HttpRequest calls back to that server. It only takes a small<br />
logical step to see that this script can expose the public API of a Web<br />
application, located on that server, via WorkerPool messaging.
</p>
<p>
Let&#8217;s pretend that I have a Web site that wants to use Google Spreadsheet as<br />
table, listing some goods for sale. Here&#8217;s how I would connect to the API using<br />
JavaScript (wildly pseudocoding):
</p>
<pre><code>
	var wp = google.gears.factory.create("beta.workerpool", "1.1");
	// create message
	var getRows = new Message("getRows");
	// ... perhaps create more messages, with parameters or not
	// set up message handler
	wp.onmessage = function(text, id) {
		var message = Message.fromJSONString(text);
		// API initiates communication
		if (message.command == "ready") {
			wp.sendMessage(getRows.toJSONString());
		}
		// ... more message processing
	}
	// finally, kick-start the whole thing by loading the API
	// URL is fictional, of course
	var api = wp.createWorkerFromUrl("http://google.com/api.js");

</code></pre>
<p>
Yeah, I am skipping lots of details, but I hope the concept is obvious: the<br />
Spreadsheet API handler is loaded as a worker, and the page can then use this<br />
API by exchanging a documented set of messages. No need to knit<br />
double-frames or server-side proxies. It just works.
</p>
<p>
Because the worker is isolated, we can set up more secure authentication and<br />
increase authentication granularity by accepting only certain messages,<br />
depending on the identity. Also, worker runs as a separate thread, which means<br />
we can do other things while the data is cooking. If it were up to me, I&#8217;d be<br />
staying up all night converting all Google API endpoints to this model and<br />
developing a good message exchange protocol. Though I might be getting too old<br />
to stay up all night without dire consequences.
</p>
<h3>
  Worker as Module<br />
</h3>
<p>
A reverse of worker-as-service model is worker as module. In this case,<br />
the application accepts cross-origin worker registration via UI, allowing them<br />
to participate via message exchange. For example, Google Reader could<br />
allow users to add plug-ins by allowing the users to enter the URL of the API.<br />
The URL could be an HTML document with some simple markup, referencing the<br />
JavaScript file, containing the plug-in. Easy-peasy. And beautiful.
</p>
<h3>
  Thinking Outside of The &lt;object&gt; Box<br />
</h3>
<p>
Finally, let&#8217;s pause for a second to ponder the way Gears is implemented.<br />
Instead of building their own<br />
<a href="http://en.wikipedia.org/wiki/Walled_garden" title="Walled Garden on Wikipedia">Eden</a><br />
inside of an object node, Gears hook up directly in DOM, without creating a<br />
<a>scripting<br />
language</a> runtime and certainly not a new<br />
<a href="http://msdn2.microsoft.com/en-us/library/bb188567.aspx" title="Silverlight Reference">declarative<br />
presentation</a> format. They organically extend HTML DOM space and DHTML<br />
developer&#8217;s horizon. What&#8217;s more, the Gearites<br />
<a href="http://gearsblog.blogspot.com/2007/05/posted-by-aaron-boodman-and-erik.html" title="Fist Gears Announcement">openly<br />
commit</a> to making (and<br />
<a href="http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2007-October/012629.html" title="WHATWG Mailing List Message">diligently</a><br />
<a href="http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2007-October/012631.html" title="WHATWG Mailing List Message">follow</a><br />
<a href="http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2007-October/012633.html" title="WHATWG Mailing List Message">through</a><br />
<a href="http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2007-September/012494.html" title="WHATWG Mailing List Message">with</a><br />
) a good effort of helping bring this extension into the new HTML spec. And I<br />
like this thinking.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/glazkov.wordpress.com/160/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/glazkov.wordpress.com/160/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/glazkov.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/glazkov.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/glazkov.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/glazkov.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/glazkov.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/glazkov.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/glazkov.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/glazkov.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/glazkov.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/glazkov.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/glazkov.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/glazkov.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/glazkov.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/glazkov.wordpress.com/160/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=glazkov.com&amp;blog=4127402&amp;post=160&amp;subd=glazkov&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://glazkov.com/2007/10/07/gearhead/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d561e3aa24ea8e6878e99cd108429329?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dglazkov</media:title>
		</media:content>
	</item>
	</channel>
</rss>
