<?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/null &#187; JavaScriptMVC</title>
	<atom:link href="http://www.nulldevice.de/tag/javascriptmvc/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nulldevice.de</link>
	<description>Static is evil.</description>
	<lastBuildDate>Fri, 18 Nov 2011 17:28:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Chaotic Pattern: Wiki is online</title>
		<link>http://www.nulldevice.de/2010/11/chaotic-pattern-wiki-is-online/</link>
		<comments>http://www.nulldevice.de/2010/11/chaotic-pattern-wiki-is-online/#comments</comments>
		<pubDate>Mon, 01 Nov 2010 21:06:45 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JavaScriptMVC]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.nulldevice.de/?p=1232</guid>
		<description><![CDATA[I recently managed to publish my latest project: chaoticpattern.net While reading the book Sync, I felt that this is the right name &#8211; an explanation can be found on the Web site. There is already some blog with the same name, but it does not seem to be very active. The last post is from May 2009. [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-medium wp-image-1235" title="Chaotic Pattern Screenshot" src="http://www.nulldevice.de/wp-content/uploads/2010/11/Screenshot-Chaotic-Pattern-Google-Chrome-500x470.png" alt="" width="300" height="282" /></p>
<p>I recently managed to publish my latest project:</p>
<p><a href="http://www.chaoticpattern.net/" target="_blank">chaoticpattern.net</a></p>
<p>While reading the book <a href="http://www.amazon.com/SYNC-Emerging-Science-Spontaneous-Order/dp/0786868449">Sync</a>, I felt that this is the right name &#8211; an explanation can be found on the Web site. There is already some blog with the same name, but it does not seem to be very active. The last post is from May 2009. Hope I don&#8217;t cause any confusion.</p>
<p>Chaotic Pattern will be used as an incubator/lab. The Wiki itself is the first in a series of experiments. It fits my personal needs as a publishing platform and is more convenient than any typical word processor out there. You can not only edit documents online, like in every other Wiki, but also produce wonderful PDFs and include content from Flickr, Youtube and Google Maps. If you like it, use it for free. There are no strings attached and I will not sell your documents or your Facebook profile <img src='http://www.nulldevice.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Also the Wiki is there to demonstrate what you can do with JavaScriptMVC 3.0 and a little bit of PHP. Theoretically, it should scale to billions of users. But as long as I don&#8217;t get any venture capital, we will never find out. Anyhow, I want people to use it as a prototype for their own apps. Until end of this year, everything should be properly documented and you can download some of the components.</p>
<p>The next step is to get the Ajax push server finally running, so that you can use the real time features. Ape is installed, but seems to cause connection problems under certain conditions. Either I can fix that with my limited resources or I have to switch to another server. It&#8217;s not like I don&#8217;t have anything else to do, so please be patient^^</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nulldevice.de/2010/11/chaotic-pattern-wiki-is-online/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to contribute to JavaScriptMVC 3.0</title>
		<link>http://www.nulldevice.de/2010/09/how-to-contribute-to-javascriptmvc-3-0/</link>
		<comments>http://www.nulldevice.de/2010/09/how-to-contribute-to-javascriptmvc-3-0/#comments</comments>
		<pubDate>Sat, 04 Sep 2010 12:25:33 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JavaScriptMVC]]></category>

		<guid isPermaLink="false">http://www.nulldevice.de/?p=1216</guid>
		<description><![CDATA[If you are reading this, I can safely assume you know what JavaScriptMVC (JMVC) is, what its features are, and what components it consists of, namely: FuncUnit (the test framework) DocumentJS (the documentation engine) jQuery (JavaScriptMVC uses a special fork with added bugfixes) JavaScriptMVC  (the core framework) Steal (the code manager / script loader; sometimes [...]]]></description>
			<content:encoded><![CDATA[<p>If you are reading this, I can safely assume you know what JavaScriptMVC (JMVC) is, what its features are, and what components it consists of, namely:</p>
<ul>
<li>FuncUnit (the test framework)</li>
<li>DocumentJS (the documentation engine)</li>
<li>jQuery (JavaScriptMVC uses a special fork with added bugfixes)</li>
<li>JavaScriptMVC  (the core framework)</li>
<li>Steal (the code manager / script loader; sometimes referred to as “StealJS”)</li>
<li>Phui  (component library for JavaScriptMVC, not part of the core)</li>
</ul>
<p>These partly independent components (together with Selenium) are bundled using git submodules (<a href="http://book.git-scm.com/5_submodules.html">http://book.git-scm.com/5_submodules.html</a>) in a repository called “framework” for your convenience:</p>
<p><a href="http://github.com/jupiterjs/framework">http://github.com/jupiterjs/framework</a></p>
<p>A detailed description of the components can be found on the Jupiter JS blog:</p>
<p><a href="http://jupiterjs.com/#news/javascriptmvc-features">http://jupiterjs.com/#news/javascriptmvc-features</a></p>
<h4>Release 2.0</h4>
<p>You should be aware that release 2.0 is still out there. Don’t get confused. It is hosted on Google Code at <a href="http://code.google.com/p/javascriptmvc/">http://code.google.com/p/javascriptmvc/</a> and uses Subversion instead of git. Don’t use the issue tracker there for bugs you find in 3.0.</p>
<p>The respective project Web sites are:</p>
<ul>
<li><a href="http://www.javascriptmvc.com/">http://www.javascriptmvc.com/</a> for 2.0</li>
<li><a href="http://v3.javascriptmvc.com/index.html%20for%203.0">http://v3.javascriptmvc.com/index.html</a> for 3.0</li>
</ul>
<h4>Ways to contribute</h4>
<p>There is a number of ways to contribute:</p>
<ol>
<li>You can fork the project repositories on github (<a href="http://github.com/jupiterjs/">http://github.com/jupiterjs/</a>) into your own repository and send a “pull request”, every time you want to submit changes (pull requests replace patches and preserve your authorship)</li>
<li>After contributing for a while, you can become a member of the JavaScriptMVC team and ask for direct write access to the project repositories</li>
<li>You can just checkout/download  the latest framework version and report bugs to the developers (<a href="http://github.com/jupiterjs/javascriptmvc/issues">http://github.com/jupiterjs/javascriptmvc/issues</a>) or answer questions on the mailing list (<a href="http://groups.google.com/group/javascriptmvc?hl=en">http://groups.google.com/group/javascriptmvc?hl=en</a>)</li>
</ol>
<h4>A few words about git</h4>
<p>In every case you should become more or less familiar with git (the distributed version control system) and github (the project hosting Web site).  The Git Community Book is a great reference: <a href="http://book.git-scm.com/index.html">http://book.git-scm.com/index.html</a>. If you are already familiar with Subversion, you might want to read the “Git &#8211; SVN Crash Course” (<a href="http://git.or.cz/course/svn.html">http://git.or.cz/course/svn.html</a>). The main idea of git is that everyone has its own repository (that’s why it’s called distributed). It allows everyone to contribute easily to Open Source projects and was initially designed and developed by Linus Torvalds for Linux kernel development.</p>
<p>In contrast to “normal” version control systems, a commit is happening on your local computer only. If you want to actually send your code to the server, you have to push it back to the remote repository. If this is not the main repository of the project but your own fork, you additionally have to send a “pull request” to the project owner (jupiterjs in that case). As a previous user of Subversion I found the whole process of checking out the source, committing my changes and pushing it back to the repository tremendously complicated, even though I understand the need for distributed version control. In part this is because git sometimes comes up with error messages that look pretty scary and that don’t help to understand the actual problem.</p>
<h4>Setup your github account</h4>
<p>After you created your free github account at <a href="http://github.com/">http://github.com/</a>, you need to go to the Account Settings page, click on “SSH Public Keys” in the left hand side navigation and then enter your public key. If you don’t have one yet, you open a text terminal on the local computer and enter:</p>
<blockquote><p>ssh-keygen -t rsa -C &#8220;youremail@address.com&#8221;</p></blockquote>
<p>There is a more detailed howto at <a href="http://help.github.com/msysgit-key-setup/">http://help.github.com/msysgit-key-setup/</a>.</p>
<p>If you run Windows, you are probably out of luck. Try to ask Google for assistance <img src='http://www.nulldevice.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Next step is to fork the repositories you want to work on. This process is pretty convenient – you simply click the fork button on the main repository page. The complete list is visible on:</p>
<p><a href="http://github.com/jupiterjs">http://github.com/jupiterjs</a></p>
<h4>Install Git and Java</h4>
<p>If not yet done, you should also install Git and Java on the local computer by using the package management software that comes with your Linux distribution. On Ubuntu you can use the “Synaptic Package Manager” for example. At least in the past, I had bad experiences with OpenJDK and Rhino (the engine that executes JMVC’s command line scripts), so I recommend installing the “original” Sun/Oracle Java version. The Selenium server also needs Java.</p>
<h4>Clone the repositories</h4>
<p>I recommend cloning (that means checkout) the “framework” repository as the first step. The build script in there allows creating the downloadable packages you see on <a href="http://github.com/jupiterjs/framework/downloads">http://github.com/jupiterjs/framework/downloads</a>. To do this, follow these 4 easy steps:</p>
<ol>
<li>Create an empty local directory that should contain all your github repositories and change into it</li>
<li>git clone git://github.com/jupiterjs/framework.git</li>
<li>git submodule init</li>
<li> git submodule update</li>
</ol>
<p>That’s it!</p>
<p>The procedure to clone your forked project repositories is similar. First you need the URL that you have to provide to Git.</p>
<p>Go to your Git home page ( <a href="http://github.com/%5busername%5d/">http://github.com/[username]/</a>) and then click on the forked respository, e.g. javascriptmvc. On the top you’ll see 3 different URLS:</p>
<ul>
<li>SSH with read and write access: This is what you want to use</li>
<li>HTTP: This is slower and offers read only access</li>
<li>Git Read-Only: Since we want to push (write) our changes to the server, this does not make sense</li>
</ul>
<p>Now simply clone it into your local github directory by typing:</p>
<p>git clone <a href="mailto:git@github.com:[username]/%5brepository%5d.git">git@github.com:[username]/[repository].git</a></p>
<h4>Push changes</h4>
<p>With Git, you can do as many commit as you want locally. Please note that the equivalent to “svn commit” is “git commit –a”. Please be nice and provide a commit message every time, for example:</p>
<blockquote><p>git commit -a &#8211;message &#8216;Changed github URLs from pinhook to jupiterjs&#8217;</p></blockquote>
<p>To see what would be commited or to see your changes since the last commit you can use “git status” and “git diff”.</p>
<p>After testing all your changes locally (this is probably worth another article, but I’m running out of time now), you are free to commit your changes to the remote repository:</p>
<blockquote><p>git push origin master</p></blockquote>
<p>You can also configure git to always push to the matching remote branch (there are other options as well, but I’m not that much into git to fully understand them, to be honest):</p>
<blockquote><p>git config push.default matching</p></blockquote>
<p>Next time you push something into that repository, it is enough to use “git push”.</p>
<p>As mentioned earlier, you have to do send a “pull request” (there is a nice button on github to do just that), if you want to send your changes from your fork to the original project repository.</p>
<h4>Pull changes for submodules</h4>
<p>In my naïve thinking, I assumed that Git will automatically update the submodule directories in the framework repository when you type “git submodule update”. This is not the case.</p>
<p>You have to manually pull the latest changes in each sub directory that contains a submodule like this:</p>
<blockquote><p>cd funcunit/</p>
<p>git checkout master (only required the first time)</p>
<p>git pull</p></blockquote>
<p>You will only get the changes in the submodules via “git pull” in the main framework directory if somebody with write access to framework does this “cd [submodule]; git pull” procedure locally and then pushes back to the repository on github:</p>
<p><a href="http://github.com/jupiterjs/framework/commit/1affd96d632b34621e9e0d06707ea83d1d4c3b9d">http://github.com/jupiterjs/framework/commit/1affd96d632b34621e9e0d06707ea83d1d4c3b9d</a></p>
<h4>Thanks</h4>
<p>Thanks for reading this. You see, I’m not a Git expert yet and I really hope I didn’t give any bad advice concerning its usage. As I improve my knowledge and find best practices how to do things most efficiently, I will update this page or post a follow-up. Especially testing is not covered in this article, which is a shame.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nulldevice.de/2010/09/how-to-contribute-to-javascriptmvc-3-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It&#8217;s really hard to talk about JavaScript best practices and JMVC</title>
		<link>http://www.nulldevice.de/2010/07/its-really-hard-to-talk-about-javascript-best-practices-and-jmvc/</link>
		<comments>http://www.nulldevice.de/2010/07/its-really-hard-to-talk-about-javascript-best-practices-and-jmvc/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 09:36:32 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JavaScriptMVC]]></category>
		<category><![CDATA[OpenAjax]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.nulldevice.de/?p=1136</guid>
		<description><![CDATA[I was totally enthusiastic, when I first learned about JavaScriptMVC &#8211; because it brings all the best practices you are accustomed to into the JavaScript world. That means the MVC architecture, Object-oriented development with simulated inheritance, EJS templates, easy testing, OpenAjax support, powerful event delegation and so on. However, I often have a hard time to [...]]]></description>
			<content:encoded><![CDATA[<p>I was totally enthusiastic, when I first learned about JavaScriptMVC &#8211; because it brings all the best practices you are accustomed to into the JavaScript world. That means the MVC architecture, Object-oriented development with simulated inheritance, EJS templates, easy testing, OpenAjax support, powerful event delegation and so on.</p>
<p>However, I often have a hard time to convince other developers about those advantages. I guess <strong>testing </strong>is the easiest one, because no developer would dare to argue against testing, even though many developers don&#8217;t do it or don&#8217;t do it right. Questions and discussions about testing seem to be very rare. Developers just discuss it with their non-technical managers, if they want to get around that &#8220;effort&#8221;.</p>
<p>But it already starts with <strong>OpenAjax</strong>. I rarely find a developer that knows what it is and what it is good for and why you might need an event hub in JS at all. Zend, W3C, IBM and Google are some of the more well-known members of the OpenAjax Alliance. If you hear about it the first time now, take the time to have a look.</p>
<p>Just yesterday I was talking to an obviously experienced JS dev (who was working for a well known mobile phone company), that was browsing through the JavaScriptMVC documentation and stopped in the chapter about <strong>EJS templates</strong>: &#8220;Yeah, I saw something similar in our own project and removed it. It is confusing, if the JS code and the HTML are in separate files, because you don&#8217;t see the code together in one file. HTML should only be edited by developers who know the JS code very well&#8221;. Not sure what to say about that. Why not give up separation of concerns at all and put everything in one big file? Then you see the big picture on your hopefully big screen. Also you always need to check the full version control system diff after each change because the file name alone doesn&#8217;t tell you what was changed and you probably have more of those exciting conflicts to resolve. And: You REALLY need to be an expert to understand what is going on. The company can never fire you, because no one else would ever understand that kind of code. Sorry for being sarcastic, but that kind of attitude can seriously damage the health of innocent other people who need to clean up the mess in 20h work days afterwards, to meet the deadline of the project. Or the project is so small that it doesn&#8217;t matter. Or the company you work for can afford to pay a lot of developers who have the time to maintain a JS app without templates.</p>
<p>Convincing people about the usefulness of <strong>controllers </strong>is not easy too. Either you start showing an OpenAjax subscribe action &#8211; then the developer most likely won&#8217;t understand what that is good for (see above). Or you talk about <strong>event delegation</strong>, then the developer will point to jQuery&#8217;s live() method, which does event delegation too. In fact, JavaScriptMVC&#8217;s event delegation used to be one of the strong points and I admit that I am not totally up to date with the whole <a href="http://groups.google.com/group/jquery-dev/browse_thread/thread/e3bb36f8a9dae2b5/7e3bc980cd327a74">discussion</a> right now, because I was busy with a PHP project during the last 6 months. I know Justin Meyer is/was working on the controller code so that it makes more use of jQuery, he contributes code to jQuery and he is in contact with John Resig. Anyways, the whole point about controllers again is <a href="http://en.wikipedia.org/wiki/Separation_of_concerns">separation of concerns</a> and not so much the technical details behind the scenes. The JavaScript world is moving very fast and implementation details change a lot, but separation of concerns is not really something that you can look at as something you probably don&#8217;t need. The JS world sometimes feels like the PHP world about 10 years ago.</p>
<p>Ok, after getting rid of those thoughts, I will return to work now. The next 2 weeks will be quite relaxed with very little work. So maybe, I can read through the new JavaScriptMVC code and update my knowledge. It really feels uncomfortable not the be able to answer questions in detail. Also I start confusing PHP and JS syntax *lol*</p>
<p>See also: <a href="http://jupiterjs.com/news/talkin-javascriptmvc-is-hard">http://jupiterjs.com/news/talkin-javascriptmvc-is-hard</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nulldevice.de/2010/07/its-really-hard-to-talk-about-javascript-best-practices-and-jmvc/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JavaScriptMVC 1.5 released</title>
		<link>http://www.nulldevice.de/2009/02/javascriptmvc-15-released/</link>
		<comments>http://www.nulldevice.de/2009/02/javascriptmvc-15-released/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 10:34:23 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JavaScriptMVC]]></category>

		<guid isPermaLink="false">http://www.nulldevice.de/?p=989</guid>
		<description><![CDATA[A new stable release of the JavaScriptMVC framework was released yesterday Justin Meyer developed it, while working with us on a new Web application. Some features like the new custom events are direct results of this project. He did an excellent job! New features include: Env.js/Shrinksafe based compression: A custom env to simulate the browser. [...]]]></description>
			<content:encoded><![CDATA[<p>A new stable release of the <a href="http://javascriptmvc.com/blog/?p=124">JavaScriptMVC framework</a> was released yesterday <img src='http://www.nulldevice.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Justin Meyer developed it, while working with us on a new Web application. Some features like the new custom events are direct results of this project. He did an excellent job!</p>
<p>New features include:</p>
<ul>
<li><strong>Env.js/Shrinksafe based compression:</strong> A custom env to simulate the browser. As the browser encounters script tags, it adds them to a collection and then compresses them. This means instant file concat and compression from the command line with no extra work.</li>
<li><strong>Env.js Testing:</strong> Prior to 1.5, tests ran in the browser only. With Env, the same tests can be run from the command line. Great for projects where you need a quick way of checking if functionality works before check-in.</li>
<li><strong>Documentation:</strong>New JavaScript based documentation library split between JSDoc and NaturalDocs.</li>
<li><strong>Code Generators:</strong> Added code generators and made building custom ones easy too by using EJS.</li>
<li><strong>Scaffolding:</strong> Helps you develop iteratively by connecting to default Rest services and providing an easily expandable CRUD interface.</li>
<li><strong>Engines+Plugins:</strong> Added a command line plugin and dependency installer. So, if a developer wanted a jQuery plugin, he can install it from the command line, and it will also grab jQuery.</li>
<li><strong>Custom Event Delegation:</strong> Besides improving event delegation to cover all the cases that even live doesn’t do, they’ve expanded it to include custom events such as drag+drop, lasso, hoverenter, mousenter. Developers can have the benefits of event delegation with these complex events.</li>
<li><strong>Easy Update:</strong> JavaScriptMVC can update itself from the command line.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.nulldevice.de/2009/02/javascriptmvc-15-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ajax and Rich Internet Application FAQ</title>
		<link>http://www.nulldevice.de/2008/10/ajax-and-rich-internet-application-faq/</link>
		<comments>http://www.nulldevice.de/2008/10/ajax-and-rich-internet-application-faq/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 11:58:57 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JavaScriptMVC]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[XSLT]]></category>

		<guid isPermaLink="false">http://www.nulldevice.de/?p=939</guid>
		<description><![CDATA[Shall I use JSON or XML as AJAX transport format? There actually is no reason to use XML instead of JSON, if you don&#8217;t plan to use XSLT. JSON is part of JavaScript which has been around since the dark ages of the web. Also, there are very fast server-side JSON implementations and JSON is [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Shall I use JSON or XML as AJAX transport format?</strong></p>
<p>There actually is no reason to use XML instead of JSON, if you don&#8217;t plan to use XSLT. JSON is part of JavaScript which has been around since the dark ages of the web. Also, there are very fast server-side JSON implementations and JSON is the more compact protocol, thus saving bandwidth.</p>
<p><strong>Isn&#8217;t XSLT much faster than to use JSON and modify the DOM with JavaScript?</strong></p>
<p>First, it is highly unlikely that there are more browsers that understand XSLT than {a: &#8216;b&#8217;}. In fact, with JSON you are on the safe side. For a client-side templating engine like <a href="http://javascriptmvc.com/learningcenter/view/learn.html">EJS</a>, the performance is not an issue.</p>
<p>Processed EJS templates simply add strings together.  They do not use eval() or have a processing step which is probably why typical templates run slow.</p>
<p>Also, XSLT is loaded from another file while EJS can be packaged with the JavaScript payload.  This necessitates an extra request by the client.</p>
<p><strong>Is it better to render the HTML on the client or an the server side?</strong></p>
<p>There is a general decision, you need to be aware of: Are you building a Rich Internet Application or do you want to beautify some HTML output with additional (JavaScript-)effects? Is the site required to be usable without JS? If you can rely on JS and if it&#8217;s a RIA, then I would suggest using a client-side MVC framework like <a href="http://www.javascriptmvc.com/">JavaScriptMVC</a>, which comes with client side controllers, template engine and model classes. Your server will mainly provide JSON-API functions and the basic page grid then, and not deliver complete HTML pages. Lots of logic (and therefore code) will move to the browser/JavaScript: In effect, you will need more JavaScript developers and less server-side developers for your projects. On the other hand, you will see a gain in consistency and also performance, as you have way less client/server communication, once the JS code is loaded (which can be pretty fast, thanks to compression). Many popular Web applications are using this approach.</p>
<p><strong>Which JavaScript library shall I use (Dojo, jQuery,&#8230;)?</strong></p>
<p>The choice of JavaScript DOM/Ajax library is IMO not so important, as long as  it doesn&#8217;t leak memory, has a small code size and offers fast DOM  queries. See</p>
<p><a class="moz-txt-link-freetext" href="http://www.domassistant.com/slickspeed/">http://www.domassistant.com/slickspeed/</a></p>
<p>The real problem you will have, is that normal event binding causes  problems because of memory leaks (circular references which can&#8217;t be  handled by the garbage collection of most browsers) and also because you  need to loop through all elements and refresh everything after doing  changes to the DOM (for example after AJAX requests that modify the  HTML). So, at the end of the day, you will want to use event delegation, which comes for free with the controllers of JavaScriptMVC.</p>
<p><strong>I know there is JavaScript &#8220;integration&#8221; in my favorite Java/PHP/Python/Perl development framework. Am I ready for building a Rich Internet Application now?</strong></p>
<p>Server-side generated JS, like what you will get when using any framework that offers JavaScript support (I&#8217;m not talking about JSON/REST here),  can be a pain, because almost certainly, you will have a very limited  feature set and maybe also problems with deployment and testing, because the common server-side frameworks can&#8217;t really test JavaScript code nor is there a smart way to  optimize generated code or structure it. Most of the approaches I&#8217;ve  seen just generate some inline JavaScript which is good for enhancing  forms a bit with new input elements/validators or offer some nice visual  effects &#8211; but that&#8217;s it. If something like this needs to be customized a  lot and grows big, you might be in trouble. Again, the question is &#8220;JavaScript enhanced Web site&#8221; or &#8220;Rich Internet Application&#8221;? To generate JavaScript with a server-side language/framework  has it&#8217;s limits and is very often not consistent, if you use  hand-written JavaScript code at the same time.</p>
<p><strong>What features should a JavaScript framework for Rich Internet Applications offer?</strong></p>
<p>I would argue that a good JavaScript framework allows an average developer to produce effective and structured code. jQuery and the like however are just browser abstraction layers (like Zend_Db is an abstraction layer for databases). Raw jQuery will almost certainly produce the same mess as raw PHP or any other server-side language that does not imply a clean application structure (MVC). You end up with reinventing the wheel and you will have different code to do similar things. Or it will just be plain slow, because without dispatching events (event delegation) you end up with looping over elements to attach events and effects, which simply gets slow for many elements. Also you will have no overview and especially inline JavaScript can&#8217;t be compressed, which means you will transfer the same source code with every request. That said, I vote for separating server-side code, JavaScript and HTML and have clearly defined interfaces. A sound architecture is a great help for all developers, as soon as there are more lines of code than fit on a screen. You don&#8217;t want to start guessing, if the code you look for is hidden in a JavaScript file, in a template, in a view helper or some other file.</p>
<p><strong>Which browsers are commonly supported for Rich Internet Applications?</strong></p>
<p>Compatibility is not a big issue anymore, if you are fine with  supporting IE 6+, Safari 3+ (incl. iPhone), Firefox 2+ and Opera 9.5+.  IE &lt; 6 is very hard to support (I would simply refuse to do so). IE 6 is  slow with JavaScript, but the real pain is it&#8217;s lack of good CSS support.</p>
<p><strong>I want to use W3C standards only (W3C DOM, XML and semantic XHTML) for my Rich Internet Application. JSON, innerHTML and DIV elements are evil, right?</strong></p>
<p>No. If you have a closer look, then you will notice that semantic HTML (for example, using the table element to render a table instead of DIVs) or  not using innerHTML sometimes offers very bad performance for DOM  manipulations, thus render the complete application useless. innerHTML very often delivers the best performance for inserting content  to the DOM. So, don&#8217;t decide on certain implementation details upfront,  especially if you plan to support IE6, which simply is an old browser  and needs some special treatment. JavaScript forces you to be very  pragmatic sometimes.</p>
<p>See <a href="http://www.quirksmode.org/dom/innerhtml.html">http://www.quirksmode.org/dom/innerhtml.html</a></p>
<p>JSON is a standard because it is implied by EMCAScript. See JSON vs. XML.</p>
<p><strong>Using parallel requests to get data from the server seems to be a good idea to speed up performance. Is there any downside?</strong></p>
<p>Depends. A major issue with modern Web applications is that the initial  loading causes many parallel requests, as you just deliver the page grid  and the JavaScript client side code then renders all the other elements from  client-side templates and loads the corresponding data (if needed) using  the mentioned JSON-APIs. A constant overhead is produced when using  comet. Parallel requests frequently cause problems, as some server-side session handler implementations  lock the session (other requests have to wait then, until the session  is accessible again). Also the many requests might require lots of  memory and server processes.</p>
<p><em>I want to thank <a href="http://javascriptmvc.com/blog/">Justin Meyer</a> (maintainer of JavaScriptMVC) for all the interesting discussions and his input on the JSON vs. XSLT debate.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nulldevice.de/2008/10/ajax-and-rich-internet-application-faq/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript Components</title>
		<link>http://www.nulldevice.de/2008/07/javascript-components/</link>
		<comments>http://www.nulldevice.de/2008/07/javascript-components/#comments</comments>
		<pubDate>Sun, 06 Jul 2008 20:05:02 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[JavaScriptMVC]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.nulldevice.de/?p=811</guid>
		<description><![CDATA[My blog was a calm place for a while now, because I&#8217;m terribly busy with writing code (like it should be&#8230;). With this posting, I want to present the prototype of JavaScript Components, which are comparable to Swing Components in Java. They make use of the Composite Pattern. That means every Component can act as [...]]]></description>
			<content:encoded><![CDATA[<p>My blog was a calm place for a while now, because I&#8217;m terribly busy with writing code (like it should be&#8230;). With this posting, I want to present the prototype of JavaScript Components, which are comparable to <a href="http://java.sun.com/docs/books/tutorial/ui/features/components.html">Swing Components</a> in Java. They make use of the <a href="http://en.wikipedia.org/wiki/Composite_pattern">Composite Pattern</a>. That means every Component can act as a container for other Components. Together with Models, Views and a Controller (Event Dispatcher), they can form reusable widgets. Other projects did work on similar things (for example <a href="https://ajax.dev.java.net/page-developer.html">jMaki Widgets</a>), but from what I see, they target different audiences. The suggested Components use a client-side only approach. They are tested with <a href="http://javascriptmvc.com/">JavaScriptMVC,</a> but may be useful for other frameworks as well. <a href="http://jquery.com/">jQuery</a> is required for DOM operations.</p>
<p>There already is a LayersComponent, which implements a content stack. Any component can be added as a new layer and only the respective top layer is visible.</p>
<p>Please check out the <a href="/downloads/jmvc/index.html">demo application</a> (<a href="/downloads/jmvc.zip">download as ZIP</a>).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nulldevice.de/2008/07/javascript-components/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

