<?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/"
	>

<channel>
	<title>The Cafes &#187; AJAX</title>
	<atom:link href="http://cafe.elharo.com/category/web/ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://cafe.elharo.com</link>
	<description>Longer than a blog; shorter than a book</description>
	<lastBuildDate>Sat, 30 Mar 2013 11:51:03 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>OpenLaszlo vs. GWT</title>
		<link>http://cafe.elharo.com/web/openlaszlo-vs-gwt/</link>
		<comments>http://cafe.elharo.com/web/openlaszlo-vs-gwt/#comments</comments>
		<pubDate>Thu, 26 Apr 2007 11:55:52 +0000</pubDate>
		<dc:creator>Elliotte Rusty Harold</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://cafe.elharo.com/web/openlaszlo-vs-gwt/</guid>
		<description><![CDATA[Last night I went to the New York City Java User&#8217;s Group to hear about AJAX toolkits, more specifically OpenLaszlo and GWT, both presented by their respective developers. It was an excellent idea to do these two talks on the same night since it made it really easy to compare and contrast the two approaches. [...]]]></description>
				<content:encoded><![CDATA[<p>Last night I went to the New York City Java User&#8217;s Group to hear about AJAX toolkits, more specifically OpenLaszlo and <abbr>GWT</abbr>, both presented by their respective developers. It was an excellent idea to do these two talks on the same night since it made it really easy to compare and contrast the two approaches. </p>
<p>I came away with a definite preference for GWT, though it&#8217;s hard to tell if that&#8217;s because of the toolkits themselves or just because of my preference for the speakers. The OpenLaszlo presentation was classic PowerPoint bullets read off the screen, along with some reasonably cool demos. The GWT presentation was done completely in Eclipse with smaller, less impressive demos. The first GWT sample code was Hello World, as it should be, so I really felt like I could see how to get this working and understand how to use it. The OpenLaszlo sample code was too complex to follow just by glancing at the screen, though likely it did something more.<br />
<span id="more-210"></span></p>
<p>OpenLaszlo seems like a confusing mix of JavaScript and XML. I never got clear on just why there was so much XML. It seemed like a classic case of misusing XML because it&#8217;s there. I suspect JavaScript alone wasn&#8217;t strongly typed enough, and the developers didn&#8217;t want to bother writing a parser for a custom format. GWT, by contrast, is pure Java so it&#8217;s a lot cleaner. I like XML; I like Java; and if I&#8217;ve taken enough drugs, sometimes I even like JavaScript. However mixing them together in the same program just seems like a really bad idea. It&#8217;s like constantly <a href="http://www.amazon.com/exec/obidos/ISBN=B0000AQS0F/ref=nosim/cafeaulaitA" title="Believe it or not there's a point to this link, and if you don't understand it, you just need to watch this.">switching from English to Chinese and back again</a> in the same sentences.</p>
<p>More importantly, OpenLaszlo seemed pretty fundamentally unRESTful. There were no URLs anywhere to be seen, and it didn&#8217;t look like the Back button, bookmarking, or linking would work. The extent to which you could write a non-Laszlo program to communicate with a Laszlo service was unclear. Ultimately what Laszlo really looked like was a way to embed a full-blown thick-client GUI into a web browser using Flash or <acronym>DHTML</acronym>. It&#8217;s an impressive trick, but it&#8217;s not really what I want to do. I&#8217;ve already got Java for that. AJAX and web applications are about moving data around between systems inside a standard <acronym>UI</acronym>, not about inventing new <acronym>UI</acronym>s. GWT seemed much less ambitious, or at least the demos of apps written in GWT shown last night were less snazzy than the demos of OpenLaszlo apps. However, they were a lot closer to the sort of web applications I actually do want to write. </p>
<p>One small point in OpenLaszlo&#8217;s favor: they understand paging, which all too few developers do. With GWT, it&#8217;s a third party add-on. The basic problem is this:  you have 100,000 records to show to a client, and it takes forever to send and display them. What do you do?</p>
<p>This is a classic problem that predates the Web, and the answer is still the same: you don&#8217;t. It&#8217;s not as if anyone is going to look at all 100,000 records at once anyway. Instead you send the first 10 or so, the current 10, the next 10, the previous 10, and the last 10. That is, you send the records the user is going to look at now, as well as the records the  user is most likely to look at next. Then as the user scrolls through the result set, you send more data as necessary but never more than a few hundred records at a time at most.</p>
<p>I&#8217;m also a bit concerned by the sheer opacity of the JavaScript code that GWT generates. It looks like it was passed through one of the 1980s era C obfuscators that allowed you to ship Unix source without actually revealing anything. The purpose here is not obfuscation. It&#8217;s optimization. However it does make hacking, debugging, and understanding much harder. I guess the response here is that we should trust the compiler. After all, it&#8217;s not as if we do all that much assembly level debugging these days anyway. However given the wide variation in browser support I&#8217;m not sure either the compiler or the runtime are worthy of that level of trust just yet.</p>
<p>Bottom line though: the next time I need to do some heavy lifting in AJAX I&#8217;m going to turn to GWT. It fits the way I think, and it uses familiar tools and languages. Doubtless as I dig deeper into it, I will find flaws. I always do. However it seems like a really nice 80/20 solution with the right hooks to escape out for a 99/1 system. OpenLaszlo just leaves me confused. I&#8217;m not saying it isn&#8217;t the better solution, but it certainly feels like the one with the much steeper learning curve.</p>
<p>P.S. The OpenLaszlo folks were asked what the difference was between their toolkit and Flex. The first answer was, &#8220;Flex isn&#8217;t open source&#8221; (or words to that effect). Then I wake up this morning and see this: <a class="2007-04-26T08:21:37Z" href="http://www.adobe.com/aboutadobe/pressroom/pressreleases/200704/042607Flex.html">Adobe to Open Source Flex</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://cafe.elharo.com/web/openlaszlo-vs-gwt/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>
