<?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>Really Aced &#187; sofea</title>
	<atom:link href="http://blog.sommestad.net/tag/sofea/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sommestad.net</link>
	<description>Web and Cocoa development through the eyes of Kristofer Sommestad, a SWAD developer.</description>
	<lastBuildDate>Sun, 23 Jan 2011 12:21:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Changing page without reloading browser</title>
		<link>http://blog.sommestad.net/2009/03/changing-page-without-reloading-browser-2/</link>
		<comments>http://blog.sommestad.net/2009/03/changing-page-without-reloading-browser-2/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 12:11:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[sofea]]></category>

		<guid isPermaLink="false">http://reallyaced.wordpress.com/?p=25</guid>
		<description><![CDATA[I wanted to investigate if we can build web applications that doesn&#8217;t require reloading of pages in the browser, according to the principles of  Life above the Service Tier. Evaluation I started by reading the &#8220;Life Above the Service Tier&#8221; document, which was a description how it works today (and its flaws) and what the [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to investigate if we can build web applications that doesn&#8217;t require reloading of pages in the browser, according to the principles of  <a href="http://wisdomofganesh.googlegroups.com/web/Life+above+the+Service+Tier+v1_1.pdf">Life above the Service Tier</a>.</p>
<h3>Evaluation</h3>
<p>I started by reading the &#8220;Life Above the Service Tier&#8221; document, which was a description how it works today (and its flaws) and what the proposed solution is.<br />
Also, I browsed the web for more articles, blog posts and comments on the issue.</p>
<h3>Summary</h3>
<p>The ideology (called SOFEA: Service-Oriented Front-End Architecture) is basically to put more rendering logic on the client side and only use the server side to transport data back and forth.</p>
<p>The principles of SOFEA could be implemented with help from AJAX. The controller resides on the client-side and is responsible for loading (XML) data and rendering the application using the received data, without actually reloading the page in the browser.<br />
This means that JavaScript would be used instead of HTML/JSP to render the server data. Also, the server-side is much thinner and not really in need of any web framework (as all it does is receive messages and return XML data).</p>
<h3>Conclusion</h3>
<p>The principles of SOFEA seem very far away from today. There are several flaws with implementing in the suggested manor:</p>
<ul>
<li>The web clients (browsers) of today <span style="text-decoration: line-through;">are not good enough to handle</span> could have problems handling as much logic as a large web site would require (given that old IE versions have so many users, ca 70-85%)</li>
<li>The client code (JavaScript) and architecture is not really mature/good enough to handle this much logic, given that it needs to be bullet-proof, easy to test etc (EDIT: unless using GWT or similar &#8211; it&#8217;s at least difficult to manage)</li>
<li>Developing applications would take much more time (hence be more expensive) as more manual labour is required to render content using JavaScript instead of letting the JSP engine do it with JSP/HTML/PHP/etc</li>
</ul>
<p><strong>Everything points to NOT implementing it in such a manor.</strong> At least not at this time, partly because the browser/client market isn&#8217;t ready for it.</p>
<h3>Is there an other way?</h3>
<p>Yes, there are other solutions to the main issue; changing pages without actually reloading the container (browser).</p>
<p>One suggested solution could be an extension to our model in Taikai, where AJAX can be used in combination with both XML, HTML/JSP and JSON, hence giving us the possibility to smoothly serve a full JSP page using AJAX.</p>
<h3>A brief description of how it <em>could </em>be solved:</h3>
<ul>
<li>Make a JavaScript &#8220;controller&#8221; handle all URL requests to the server, in order to bind the answer to a certain action.</li>
<li>Set up &#8220;View XML files&#8221; for all views that are to be loaded with AJAX. The view could look something like this:</li>
</ul>
<pre style="padding-left:30px;">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;xmlRoot&gt;
&lt;title&gt;Document title&lt;/title&gt;
&lt;styles&gt;
&lt;src&gt;/css/foo.css&lt;/src&gt;
&lt;src&gt;/css/bar.css&lt;/src&gt;
&lt;/styles&gt;
&lt;scripts&gt;
&lt;src&gt;/js/foo.js&lt;/src&gt;
&lt;src&gt;/js/bar.js&lt;/src&gt;
&lt;/scripts&gt;
&lt;content id="targetContainerId"&gt;
&lt;![CDATA[&lt;jsp:include file="foo.jsp" /&gt;]]&gt;
&lt;/content&gt;
&lt;/xmlRoot&gt;</pre>
<ul>
<li>When returning the response from the server, the returning page would be the pre-defined XML (as per above).</li>
<li>The controller parses the contents of the returned XML file and performs its magic:</li>
</ul>
<ol>
<li>Changing the document title</li>
<li>Loading new styles and scripts (and possibly unloading old ones to keep the page slim)</li>
<li>Updating the content element (with id=&#8221;targetContainerId&#8221;) with the provided content, which has been rendered by the JSP engine and therefore taking advantage of its power (i.e. JSTL, HTML tags etc etc).</li>
<li>Updating the browser history using hash (#) technique, allowing for back/forward movement while remaining in the same page container</li>
</ol>
<h3>The main advantages with such a solution would be:</h3>
<ul>
<li>Allowing developers to create content using known and powerful formats, such as HTML and JSP</li>
</ul>
<ol>
<li>Very important in respect to time efficiency</li>
<li>Still allows for easier debugging and development</li>
<li>No need to put too much logic on the JavaScript side, i.e. creating elements etc (although it could still be done in some components, if needed/wanted)</li>
</ol>
<ul>
<li>Still providing the user with the quicker experience of a site without (or with few) full page reloads</li>
</ul>
<h3>Remaining questions:</h3>
<ul>
<li>Would there be any risk of memory leaks, especially in older Internet Explorer browsers? And is there an easy way of eliminating these?</li>
<li>Is the support for &#8220;hash history technique&#8221; good enough in all major browsers?</li>
</ul>
<h3>References</h3>
<ul>
<li><a href="http://www.slideshare.net/andre.neubauer/sofea-soui-web-future-without-web-frameworks-presentation">Presentation of a suggested full SOFEA solution with AJAX and Comet</a></li>
<li><a href="http://css.dzone.com/news/choosing-an-ajax-framework">Discussion on a SOFEA development project</a></li>
<li><a href="http://bittwiddler.wordpress.com/2008/05/04/sofea-is-beautiful/">Summary of the large &#8220;Life above&#8230;&#8221; document and subjective comments</a></li>
<li><a href="http://azeditech.com/node/44">Comments on SOFEA flaws</a></li>
<li><a href="http://groups.google.com/group/sofea/topics">SOFEA Google Group with discussions</a></li>
<li><a href="http://raibledesigns.com/rd/entry/re_life_above_the_service">Matt Raible&#8217;s views on why and why not to use SOFEA</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.sommestad.net/2009/03/changing-page-without-reloading-browser-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

