<?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>dev.enekoalonso.com &#187; require</title>
	<atom:link href="http://dev.enekoalonso.com/tag/require/feed/" rel="self" type="application/rss+xml" />
	<link>http://dev.enekoalonso.com</link>
	<description>having fun with code</description>
	<lastBuildDate>Wed, 12 Oct 2011 21:40:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Dojo y yo</title>
		<link>http://dev.enekoalonso.com/2010/01/28/dojo-y-yo/</link>
		<comments>http://dev.enekoalonso.com/2010/01/28/dojo-y-yo/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 05:48:02 +0000</pubDate>
		<dc:creator>Eneko Alonso</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[closure]]></category>
		<category><![CDATA[dependencies]]></category>
		<category><![CDATA[dependency]]></category>
		<category><![CDATA[dojo]]></category>
		<category><![CDATA[goog]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[include]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[require]]></category>

		<guid isPermaLink="false">http://dev.enekoalonso.com/?p=423</guid>
		<description><![CDATA[Back in November 2008 I had a chance to work with Dojo on a project for Cisco WebEx. I didn&#8217;t like it at all. I was used to the simplicity of jQuery and Mootools and I couldn&#8217;t understand how Dojo had been designed so complicated. Well, one year later I just realized that it is [...]]]></description>
			<content:encoded><![CDATA[<p>Back in November 2008 I had a chance to work with <a href="http://dojotoolkit.org/">Dojo</a> on a project for <a href="http://www.webex.com/iphone/">Cisco WebEx</a>. I didn&#8217;t like it at all. I was used to the simplicity of jQuery and Mootools and I couldn&#8217;t understand how Dojo had been designed so complicated. Well, one year later I just realized that it is not that Dojo was that complicated. It is that I wasn&#8217;t ready for it. Now it is time to give it another chance.</p>
<h3>Some cool stuff about Dojo</h3>
<p>Reading Dojo&#8217;s documentation I have finally understood something that I was wondering how it works. It&#8217;s nothing really complicated, but it&#8217;s actually very cool: <a href="http://api.dojotoolkit.org/jsdoc/HEAD/dojo.require">dojo.require</a></p>
<p>Javascript requests to the server are asynchronous (not sure if synchronous request can be done). So we depend on callback functions to continue the flow of your program. That means that when we put <code lang="javascript">dojo.require('somefancyjs');</code> on a line, the execution does not stop and it continues to the next line of code while the browser downloads that file from the server in the background.</p>
<p>Looks like Dojo puts those requests on some kind of array, array that is checked when you use <code>dojo.addOnLoad()</code> which does not execute your callback function until all elements of the array have been downloaded. That is very cool because that means you can do as many dojo.require&#8217;s as you need. The down side is that you need to put your code inside a callback function, which is not very bad when working with objects.</p>
<p>Next, I have to find out how goog.require works ;)</p>
<h3  class="related_post_title">Related Posts:</h3><ul class="related_post"><li>May 16, 2010 -- <a href="http://dev.enekoalonso.com/2010/05/16/performance-matters/" title="Performance matters">Performance matters</a> (2)</li><li>January 28, 2010 -- <a href="http://dev.enekoalonso.com/2010/01/28/things-to-do/" title="Things to do">Things to do</a> (0)</li><li>May 6, 2010 -- <a href="http://dev.enekoalonso.com/2010/05/06/tech-talks-at-level-studios/" title="Tech talks at LEVEL Studios">Tech talks at LEVEL Studios</a> (0)</li><li>March 15, 2010 -- <a href="http://dev.enekoalonso.com/2010/03/15/more-updates-to-mooml-coming-soon/" title="More updates to Mooml coming soon">More updates to Mooml coming soon</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://dev.enekoalonso.com/2010/01/28/dojo-y-yo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

