<?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>Francesco Iovine</title>
	<atom:link href="http://www.francesco.iovine.name/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.francesco.iovine.name/blog</link>
	<description>developer blog</description>
	<lastBuildDate>Tue, 04 Oct 2011 19:34:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to control the back button in Javascript</title>
		<link>http://www.francesco.iovine.name/blog/2011/10/04/how-to-control-the-back-button-in-javascript/</link>
		<comments>http://www.francesco.iovine.name/blog/2011/10/04/how-to-control-the-back-button-in-javascript/#comments</comments>
		<pubDate>Tue, 04 Oct 2011 19:33:13 +0000</pubDate>
		<dc:creator>franciov</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://www.francesco.iovine.name/blog/?p=374</guid>
		<description><![CDATA[If you really care about User Experience (UX), you would love to give your Mobile Web App full control of native buttons, including browser buttons and physical buttons. Android devices rely on a back button to provide users a cross-app backward navigation that is part of the whole Android UX.
In order to take control of [...]]]></description>
			<content:encoded><![CDATA[<p>If you really care about User Experience (UX), you would love to give your Mobile Web App full control of native buttons, including browser buttons and physical buttons. Android devices rely on a back button to provide users a cross-app backward navigation that is part of the whole Android UX.</p>
<p>In order to take control of the native back button, we can link it to a DOM back button with a listener registered on. In this way once we intercepted the &#8220;click&#8221; event on the native back button, we can run the handlers registered on the DOM back button for the &#8220;click&#8221; event.</p>
<p>First of all, we need a function providing the list of handlers registered to a DOM element, something like the <a href="http://www.w3.org/TR/2001/WD-DOM-Level-3-Events-20010823/events.html#Events-EventListenerList">EventListenerList interface</a> introduced in DOM level 3 and disappeared in <a href="http://www.w3.org/TR/DOM-Level-3-Events/">the last draft of DOM level 3 Events Specification</a>.</p>
<p>So, let&#8217;s define this function by using  <a href="http://jquery.com/">jQuery</a>:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">$.<span class="me1">fn</span>.<span class="me1">listHandlers</span> = <span class="kw2">function</span><span class="br0">&#40;</span>events, outputFunction<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw1">this</span>.<span class="me1">each</span><span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span>i<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dEvents = $<span class="br0">&#40;</span><span class="kw1">this</span><span class="br0">&#41;</span>.<span class="me1">data</span><span class="br0">&#40;</span><span class="st0">&#8216;events&#8217;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>!dEvents<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $.<span class="me1">each</span><span class="br0">&#40;</span>dEvents, <span class="kw2">function</span><span class="br0">&#40;</span><span class="kw3">name</span>, handler<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="br0">&#40;</span><span class="kw2">new</span> RegExp<span class="br0">&#40;</span><span class="st0">&#8216;^(&#8217;</span> + <span class="br0">&#40;</span>events === <span class="st0">&#8216;*&#8217;</span> ? <span class="st0">&#8216;.+&#8217;</span> : events.<span class="me1">replace</span><span class="br0">&#40;</span><span class="st0">&#8216;,&#8217;</span>,<span class="st0">&#8216;|&#8217;</span><span class="br0">&#41;</span>.<span class="me1">replace</span><span class="br0">&#40;</span><span class="re0">/^on/i</span>,<span class="st0">&#8221;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> + <span class="st0">&#8216;)$&#8217;</span> ,<span class="st0">&#8216;i&#8217;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>.<span class="me1">test</span><span class="br0">&#40;</span><span class="kw3">name</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $.<span class="me1">each</span><span class="br0">&#40;</span>handler, <span class="kw2">function</span><span class="br0">&#40;</span>i,handler<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; outputFunction<span class="br0">&#40;</span>handler<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span>;</div>
</div>
<p>Now, we need to intercept the &#8220;click&#8221; event on the native back button. The &#8220;hashchange&#8221; <a href="http://benalman.com/news/2010/03/jquery-special-events/#add-and-remove-hashchange">jQuery special event</a> does the job: if a location.hash exists, whenever the browser back button is clicked the location.hash changes.</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">function</span> controlBackwardNavigation<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span>window<span class="br0">&#41;</span>.<span class="me1">unbind</span><span class="br0">&#40;</span><span class="st0">&#8216;hashchange&#8217;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; window.<span class="me1">location</span>.<span class="me1">hash</span> = encodeURIComponent<span class="br0">&#40;</span><span class="st0">&quot;myHash&quot;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; setTimeout<span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span> &nbsp;<span class="co1">// timeout for encodeURIComponent overhead</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span>window<span class="br0">&#41;</span>.<span class="me1">bind</span><span class="br0">&#40;</span><span class="st0">&#8216;hashchange&#8217;</span>, <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="st0">&quot;#myDomBackButtonId&quot;</span><span class="br0">&#41;</span>.<span class="me1">listHandlers</span><span class="br0">&#40;</span><span class="st0">&#8216;onclick&#8217;</span>, <span class="kw2">function</span><span class="br0">&#40;</span>handler<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; handler<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; takeControlOfBackwardNavigation<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> , <span class="nu0">100</span><span class="br0">&#41;</span>; <span class="co1">// 100 ms works on most Android devices and iPhone</span><br />
<span class="br0">&#125;</span></div>
</div>
<p><strong>Done.</strong> Now Android users can navigate backward on your Mobile Web App by using Android UX.</p>
<p>We could make the code above simpler by using the <a href="http://www.w3.org/TR/html5/history.html#event-definitions">HTML5 State Management Functionality</a> in this way:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">function</span> controlBackwardNavigation<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span>window<span class="br0">&#41;</span>.<span class="me1">bind</span><span class="br0">&#40;</span><span class="st0">&#8216;popState&#8217;</span>, <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="st0">&quot;#myDomBackButtonId&quot;</span><span class="br0">&#41;</span>.<span class="me1">listHandlers</span><span class="br0">&#40;</span><span class="st0">&#8216;onclick&#8217;</span>, <span class="kw2">function</span><span class="br0">&#40;</span>handler<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; handler<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span></div>
</div>
<p>Unfortunately this code doesn&#8217;t work yet on mobile browsers (tested on Android 2.2 and iPhone OS 4.3) but support for HTML5 features is being added extremely quickly to most browsers, so I would not surprised to see this working in few months.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.francesco.iovine.name/blog/2011/10/04/how-to-control-the-back-button-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Better Software and Frontiers of Interaction</title>
		<link>http://www.francesco.iovine.name/blog/2010/05/17/better-software-and-frontiers-of-interaction/</link>
		<comments>http://www.francesco.iovine.name/blog/2010/05/17/better-software-and-frontiers-of-interaction/#comments</comments>
		<pubDate>Sun, 16 May 2010 22:47:04 +0000</pubDate>
		<dc:creator>franciov</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[events]]></category>

		<guid isPermaLink="false">http://www.francesco.iovine.name/blog/?p=362</guid>
		<description><![CDATA[Spring has finally sprung (in spite of the rain&#8230;) and there are plenty of events taking place here in Italy. At the beginning of May I attended the Better Software conference in Florence, maybe the most important conference about software in Italy, in which I had the pleasure to meet Peldi from Balsamiq who left [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://frontiers.idearium.org/2010/"><img class="size-full wp-image-364  alignleft" src="http://www.francesco.iovine.name/blog/wp-content/uploads/2010/05/logo-frontiers.png" alt="Frontiers of Interaction 2010" width="180" height="220" /></a>Spring has finally sprung (in spite of the rain&#8230;) and there are plenty of events taking place here in Italy. At the beginning of May I attended the <a id="aptureLink_WlVXxSDokL" href="http://www.bettersoftware.it/">Better Software</a> conference in Florence, maybe the most important conference about software in Italy, in which I had the pleasure to meet <a href="http://www.balsamiq.com/company#peldi">Peldi from Balsamiq</a> who left a huge impression on me with his boundless energy and enthusiasm.</p>
<p><a href="http://www.leeander.com/">Leandrò Agrò</a>, speaker at Better Software, convinced me to attend <a href="http://frontiers.idearium.org/2010/">Frontiers of Interaction</a> &#8211; the crossroads of innovation in Italy. What interests me most is that this conference is not specifically about software. &#8220;It&#8217;s not about software at all!&#8221;, you might say. Well, what&#8217;s not <em>about</em> software? I found out I&#8217;m much more interested to what is <em>related to</em> software than software itself. I mean interaction design of course, user experience, business, but also <a href="http://www.slideshare.net/leeander/dai-protocolli-allastartupbsw2010">pollution, cyber punk, italian design, parallel computing</a> &#8230;</p>
<p>See you there!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.francesco.iovine.name/blog/2010/05/17/better-software-and-frontiers-of-interaction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Model-View-Controller (MVC) with JavaScript</title>
		<link>http://www.francesco.iovine.name/blog/2010/01/20/model-view-controller-mvc-with-javascript/</link>
		<comments>http://www.francesco.iovine.name/blog/2010/01/20/model-view-controller-mvc-with-javascript/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 12:28:11 +0000</pubDate>
		<dc:creator>franciov</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://www.francesco.iovine.name/blog/?p=329</guid>
		<description><![CDATA[In developing Javascript Applications, the best thing you can do is rely on a framework such as SproutCore (that has recently reached version 1.0) or JavascriptMVC. However in some cases the Dojo toolkit or the jQuery library can satify most of your needs, expecially when you are relatively new to Javascript or just want to [...]]]></description>
			<content:encoded><![CDATA[<p>In developing Javascript Applications, the best thing you can do is rely on a framework such as <a href="http://www.sproutcore.com/" target="_blank">SproutCore</a> (that has recently reached version 1.0) or <a href="http://javascriptmvc.com/" target="_blank">JavascriptMVC</a>. However in some cases the <a href="http://www.dojotoolkit.org/" target="_blank">Dojo toolkit</a> or the <a href="http://jquery.com/" target="_blank">jQuery library</a> can satify most of your needs, expecially when you are relatively new to Javascript or just want to avoid the initial learning time associated to the use of a framework. But, as often happens in these situations, the lack of a framework, or at least of standardized and shared solutions, causes problems with maintainability, extensibility and complexity.  This is particularly true for <a href="http://www.francesco.iovine.name/blog/2009/10/07/the-vodafone-widget-developer-port-a-thon/" target="_blank">Mobile Widgets</a>, which are relatively simple Javascript Applications which don&#8217;t need, at least in my experience, a framework on which rely on, but need to implement <a id="aptureLink_NSNoie2mDU" href="http://en.wikipedia.org/wiki/Architectural%20pattern%20%28computer%20science%29">architectural patterns</a> and <a id="aptureLink_XYLBaYRFol" href="http://en.wikipedia.org/wiki/Design%20pattern%20%28computer%20science%29">design patterns</a>.</p>
<p>My goal for this article is to show how to create the main structure of a <a id="aptureLink_Kqgme04OXU" href="http://en.wikipedia.org/wiki/Model-view-controller">MVC-based</a> Javascript Application using pure Javascript in defining classes, and the jQuery library to access and manipulate the <a id="aptureLink_dF9ZkShnKv" href="http://en.wikipedia.org/wiki/Document%20Object%20Model">DOM</a>.</p>
<p><strong>Model</strong><br />
Let&#8217;s start with the implementation of a Model object. <em>ListModel</em> is a very simple class that implements a list of items, in which items can be added and deleted.</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">function</span> ListModel<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">this</span>._items = <span class="kw2">null</span>;<br />
<span class="br0">&#125;</span><br />
ListModel.<span class="me1">prototype</span> = <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; init : <span class="kw2">function</span> <span class="br0">&#40;</span>items<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">this</span>._items = items;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>,</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; getItems : <span class="kw2">function</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw1">this</span>._items;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>,</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; addItem : <span class="kw2">function</span> <span class="br0">&#40;</span><span class="kw1">item</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">this</span>._items.<span class="me1">push</span><span class="br0">&#40;</span><span class="kw1">item</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>,</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; removeItemAt : <span class="kw2">function</span> <span class="br0">&#40;</span>index<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">this</span>._items.<span class="me1">splice</span><span class="br0">&#40;</span>index, <span class="nu0">1</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span><span class="br0">&#41;</span>;</div>
</div>
<p><strong>View</strong><br />
The View implements an action form which is included inside the <span><em>finditems</em> HTML div, consisting of an input text field and a button to apply the form. The <em>init</em> method bind the apply button to the method <em>findItemsController</em>&#8217;s <em>apply</em> method, for the <em>click</em> event. The <em>show</em> method cleans the screen and makes the view visible, the <em>hide</em> method makes the view not visible, and the <em>getInputValue</em> method returns the value that has been inserted in the input text field.</span></p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">function</span> FindItemsView<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">this</span>.<span class="me1">view</span> = <span class="st0">&quot;#finditems_div&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">this</span>.<span class="me1">inputTextfield</span> = <span class="st0">&quot;#finditems_input&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">this</span>.<span class="me1">applyButton</span> = <span class="st0">&quot;#finditems_apply&quot;</span>;<br />
<span class="br0">&#125;</span><br />
FindItemsView.<span class="me1">prototype</span> = <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; init : <span class="kw2">function</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="kw1">this</span>.<span class="me1">applyButton</span><span class="br0">&#41;</span>.<span class="me1">click</span><span class="br0">&#40;</span>findItemsController.<span class="me1">apply</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>,</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; show : <span class="kw2">function</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="kw1">this</span>.<span class="me1">view</span><span class="br0">&#41;</span>.<span class="me1">show</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>,</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; hide : <span class="kw2">function</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="kw1">this</span>.<span class="me1">view</span><span class="br0">&#41;</span>.<span class="me1">hide</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>,</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; getInputValue : <span class="kw2">function</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> $<span class="br0">&#40;</span><span class="kw1">this</span>.<span class="me1">input</span><span class="br0">&#41;</span>.<span class="me1">val</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span>;</div>
</div>
<p><strong>Controller</strong><br />
The <em>FindItemsView</em> class is tightly bound with the <em>FindItemsController</em>class, which handles the input event from the user interface via direct calls, registered handlers or callbacks. In our example <em>FindItemsController</em>&#8217;s <em>apply</em> method is called when the apply button is pressed (this event has been register in the <em>init</em> method of the <em>FindItemsView</em> class), gets the value of the input field from the View, then performs an asyncronous call to a service: the response handler is </span><span><em>FindItemsController</em></span><span> itself, and three callback methods (<em>success</em>, <em>error</em> and <em>timeout</em>) are passed. If nothing goes wrong, the <em>success</em> callback is called and a new <em>ListModel</em> object is created and initialized with retrieved items. At this point the control is given to </span>the ListItemsController, that has the responsibility to display the <em>ListModel</em> on a different View.</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">function</span> FindItemsController<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
<span class="br0">&#125;</span><br />
FindItemsController.<span class="me1">prototype</span> = <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; init : <span class="kw2">function</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>,</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; apply : <span class="kw2">function</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> input = findItemsView.<span class="me1">getInput</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; service.<span class="me1">findItem</span><span class="br0">&#40;</span>input, findItemsController, success, error, timeout<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>,</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; success : <span class="kw2">function</span> <span class="br0">&#40;</span> items <span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; listModel = <span class="kw2">new</span> ListModel<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; listModel.<span class="me1">init</span><span class="br0">&#40;</span>items<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; listItemsController.<span class="me1">display</span><span class="br0">&#40;</span>listModel<span class="br0">&#41;</span>; <span class="coMULTI">/* give the control to &#8216;listItemsView&#8217; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>,</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; error : <span class="kw2">function</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">alert</span><span class="br0">&#40;</span><span class="st0">&quot;Error&quot;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>,</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; timeout : <span class="kw2">function</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">alert</span><span class="br0">&#40;</span><span class="st0">&quot;Timeout&quot;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span>;</div>
</div>
<p>Alright! This is the starting point to write a MVC-based Javascript Application using pure Javascript and jQuery library. Alex Netkachov in <a href="http://www.alexatnet.com/node/8" target="_blank">this article</a> shows how to write a simple MVC-based JavaScript component with the support of the <a id="aptureLink_7Ry6bBK7jJ" href="http://en.wikipedia.org/wiki/Dojo%20Toolkit">Dojo</a> language utilities. Also want to point out <a href="http://cdn.javascriptmvc.com/videos/2_0/2_0_demo.htm">this interesting video</a> about <a href="http://javascriptmvc.com/" target="_blank">JavascriptMVC</a>: using a framework or a toolkit is rarely a bad idea.</p>
<p>Well, since in this period I am extensively developing Mobile Widgets (i.e. Javascript Application), I&#8217;m going to come back on the subject soon, showing how to implement widely used design patterns, such as <a id="aptureLink_89hgzP6aoQ" href="http://en.wikipedia.org/wiki/Observer%20pattern">Observer</a>, <a id="aptureLink_MFn9ZTLSgJ" href="http://en.wikipedia.org/wiki/Facade%20pattern">Facade</a>, <a id="aptureLink_sYnvdXYnDQ" href="http://en.wikipedia.org/wiki/Singleton%20pattern">Singleton</a> and <a id="aptureLink_Y5Qtkogzk1" href="http://en.wikipedia.org/wiki/Factory%20Pattern">Factory</a>.</p>
<p>Stay tuned !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.francesco.iovine.name/blog/2010/01/20/model-view-controller-mvc-with-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Vodafone widget developer port-a-thon</title>
		<link>http://www.francesco.iovine.name/blog/2009/10/07/the-vodafone-widget-developer-port-a-thon/</link>
		<comments>http://www.francesco.iovine.name/blog/2009/10/07/the-vodafone-widget-developer-port-a-thon/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 13:05:44 +0000</pubDate>
		<dc:creator>franciov</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[events]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://www.francesco.iovine.name/blog/?p=312</guid>
		<description><![CDATA[In this moment I&#8217;m on a train heading back to Rome from the Novotel Hotel in Milan where I participated in the Vodafone widget developer port-a-thon (October 5 and 6). Vodafone and the JIL team provided a presentation of the upcoming JIL Developer Portal, market opportunity associated to mobile widgets and brand new devices. But [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.jil.org/"><img class="size-full wp-image-313 alignleft" title="JIL_partners" src="http://www.francesco.iovine.name/blog/wp-content/uploads/2009/10/JIL_partners.jpg" alt="JIL_partners" width="350" height="183" /></a>In this moment I&#8217;m on a train heading back to Rome from the Novotel Hotel in Milan where I participated in the Vodafone widget developer port-a-thon (October 5 and 6). Vodafone and the JIL team provided a presentation of the upcoming <a href="http://www.jil.org/" target="_blank">JIL Developer Portal</a>, market opportunity associated to mobile widgets and brand new devices. But above all this meeting has been a working session: I had to bring my laptop and to roll up my sleeves and get to work. The JIL team provided us user experience guidelines, quality criteria to follow for a widget to be accepted for publishing, showed how to port a real mobile widget and supported us all the time in developing our widgets through JIL Widget SDK and JIL Software Development Kit (Eclipse-based IDE). The JIL team also provided brand new devices on which we installed our widgets for testing purpose.</p>
<p>I come from mobile web site and application development for mobile handsets, and mobile widgets are rather a new thing for me despite I had to deal with Nokia Web Runtime some months ago. At first glance mobile widgets seem to incorporate all advantages associated on both classic mobile applications and browser &#8220;applications&#8221; (i.e. mobile web sites):</p>
<ul>
<li>Web technology</li>
<li>Low learning curve</li>
<li>Portability</li>
<li>Easy to Layout</li>
<li>Offine content store</li>
<li>One Package</li>
</ul>
<p>However JIL Widget SDK is actually far from perfect: lack of features (to be implemented), device heterogeneity and limitations, different Web RunTimes to be handled. Fortunately the JIL project, currently in Beta, consists of a skilled team of developers and a large community, so I&#8217;m sure platform stability will be improved, missing features will be implemented and new features will be added.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.francesco.iovine.name/blog/2009/10/07/the-vodafone-widget-developer-port-a-thon/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The best Ruby on Rails IDE for Mac OS X: TextMate VS AptanaStudio</title>
		<link>http://www.francesco.iovine.name/blog/2009/07/24/the-best-ruby-on-rails-ide-for-max-os-x-textmate-vs-aptanastudio/</link>
		<comments>http://www.francesco.iovine.name/blog/2009/07/24/the-best-ruby-on-rails-ide-for-max-os-x-textmate-vs-aptanastudio/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 23:31:42 +0000</pubDate>
		<dc:creator>franciov</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[macos]]></category>
		<category><![CDATA[rubyonrails]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://www.francesco.iovine.name/blog/?p=265</guid>
		<description><![CDATA[
Ruby on Rails is a Full-Stack Web Framework I started working with in 2007.
Convention over configuration through naming conventions, Ruby on Rails reduces the repetitive writing of configuration tasks. Less code means less potential for bugs.
This is the feature that made me fall in love with this framework, and that, incidently, makes hard to find [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-276" title="textmate_vs_aptana" src="http://www.francesco.iovine.name/blog/wp-content/uploads/2009/07/textmate_vs_aptana.jpg" alt="textmate_vs_aptana" width="250" height="113" /></p>
<p><a href="http://rubyonrails.org/" target="_blank">Ruby on Rails</a> is a Full-Stack Web Framework I started working with in 2007.</p>
<blockquote><p>Convention over configuration through naming conventions, Ruby on Rails reduces the repetitive writing of configuration tasks. Less code means less potential for bugs.</p></blockquote>
<p>This is the feature that made me fall in love with this framework, and that, incidently, makes hard to find a full featured IDE specific for Ruby on Rails.</p>
<p>Here we compare <a href="http://macromates.com/" target="_blank">TextMate</a> + <a href="http://railsbundle.com/" target="_blank">RailsBundles</a> with <a href="http://www.aptana.com/rails" target="_blank">Aptana RadRails</a> to choose the best Ruby on Rails IDE for Mac OS X. I&#8217;m sorry I couldn&#8217;t take NetBeans IDE into account, because unfortunately my good old iBook PPC is simply too slow for it.</p>
<h3>Performance</h3>
<p>Textmate is by far the faster one, there&#8217;s no comparison at all. Everything you do with Textmate doesn&#8217;t take more than 1-2 seconds to complete, whereas Aptana Studio takes half a minute sometimes.</p>
<h3>Plugins and configurability</h3>
<p>In TextMate Bundles are Plugins. Textmate is highly configurable just if you know how (and have time) to work from command line and edit or create bundles by youself, otherwise you just have to understand how commands, macros and snippets provided by RailsBundles work.</p>
<p>On the other hand Aptana RadRails is based on Eclipse, that means it&#8217;s a full featured IDE with a world of plugins to support Subversion and Git for instance, and is easily configurable via graphic interface. Unfortunately it inherits from Eclipse itself, and especially from plugins, configuration limitations and bugs.</p>
<h3>Auto-complete</h3>
<p>TextMate has no auto-complete, and no documentation about Rails: this is a big lack especially if you are new to Ruby on Rails and you don&#8217;t know much about existing classes, functions and keywords. I started programming in Ruby on Rails using TextMate and without knowing how bundles work, it was just like using a text editor such as VIM: I used to continuously switch among TextMate, the console for Rake and scripts, and Firefox for documentation. The beauty of auto-complete is that it helps you learn your classes, the libraries you&#8217;re using (if any) and the framework you&#8217;re working on. After all, TextMate is the missing editor for Mac OS X: it doesn&#8217;t aim to be an IDE.</p>
<p>Lack of auto-complete in TextMate has been the main reason that made me switch to Aptana, even if it doesn&#8217;t perform very good: sometimes takes more than 5 seconds to show up the list of entries, and up to 5 seconds to make the entry documentation appear.</p>
<h3>Rake/Mongrel/Browser integration</h3>
<p>RailsBundles allows TextMate to perform some rake tasks, such as migrations, without switching to Darwin. That&#8217;s that, unless you want to write your bundles, obviously&#8230;</p>
<p>On the other hand, Aptana RadRails provides a nice interface in which you can run scripts, rake tasks and control all your servers: logs are tailed inside the IDE so you can take the outcome under control. Moreover a browser is integrated inside the IDE so that you never need to switch to Firefox or Safari. That&#8217;s what an IDE should offer.</p>
<h3>Price</h3>
<p>TextMate costs about 50€.<br />
AptanaStudio is free.</p>
<p>Have a look at <a href="http://www.aptana.tv/movies/aptana_radrails_intro/aptana_radrails_intro.html" target="_blank">RadRails on Aptana.tv</a> .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.francesco.iovine.name/blog/2009/07/24/the-best-ruby-on-rails-ide-for-max-os-x-textmate-vs-aptanastudio/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to skip a step in a Spring AbstractWizardFormController</title>
		<link>http://www.francesco.iovine.name/blog/2009/07/22/how-to-skip-a-step-in-a-spring-abstractwizardformcontroller/</link>
		<comments>http://www.francesco.iovine.name/blog/2009/07/22/how-to-skip-a-step-in-a-spring-abstractwizardformcontroller/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 00:41:32 +0000</pubDate>
		<dc:creator>franciov</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://www.francesco.iovine.name/blog/?p=247</guid>
		<description><![CDATA[
Here we are again dealing with the Abstract Wizard Form Controller, a form controller for typical wizard-style workflows, provided by Spring, a Java Web Application Framework. This time we discuss a more frequent problem: skipping steps.
For istance, let&#8217;s consider the situation in which you are at page n of your wizard and submitting a form [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-245" title="spring-framework-2.5" src="http://www.francesco.iovine.name/blog/wp-content/uploads/2009/07/spring-framework-2.5.png" alt="spring-framework-2.5" width="250" height="118" /></p>
<p>Here we are <a title="how to manipulate pages at runtime" href="http://www.francesco.iovine.name/blog/2009/07/19/spring-abstractwizardformcontroller-how-to-manipulate-pages-at-runtime/" target="_self">again</a> dealing with the <a title="Spring Framework API 2.5" onclick="javascript:pageTracker._trackPageview('/outbound/article/static.springsource.org');" href="http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/web/portlet/mvc/AbstractWizardFormController.html" target="_blank">Abstract Wizard Form Controller</a>, a form controller for typical wizard-style workflows, provided by <a title="SpringSource.org" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.springsource.org');" href="http://www.springsource.org/" target="_blank">Spring</a>, a Java Web Application Framework. This time we discuss a more frequent problem: skipping steps.</p>
<p>For istance, let&#8217;s consider the situation in which you are at page <i>n</i> of your wizard and submitting a form for target <i>n+1</i>. What if, for some reason, you need to skip the step <i>n+1</i> and go forward one step?</p>
<p>The first attempt to face this problem might consists in conditionally changing the target value inside the form included in the jsp page corresponding to the view for page <i>n</i>. For example we might switch between passing the request parameter <i>_target3</i> or <i>_target4</i> by using the <a href="http://java.sun.com/products/jsp/jstl/" target="_blank">JSTL Core TagLib</a>. This works, but we are putting a conditional control inside a View, that is a very bad practice in a MVC-based framework like Spring.</p>
<p>Let&#8217;s move the conditional control into our wizard controller, and to be more precise into the <a href="http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/web/portlet/mvc/AbstractWizardFormController.html#getTargetPage(javax.portlet.PortletRequest,%20java.lang.Object,%20org.springframework.validation.Errors,%20int)" target="_blank">getTargetPage</a> method:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">protected</span> <span class="kw4">int</span> getTargetPage<span class="br0">&#40;</span>HttpServletRequest request, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AObject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Object</span></a> command, Errors errors, <span class="kw4">int</span> currentPage<span class="br0">&#41;</span> <span class="br0">&#123;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>currentPage == <span class="nu0">2</span> <span class="coMULTI">/* n */</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="coMULTI">/* insert your condition here*/</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">return</span> <span class="nu0">3</span>; <span class="coMULTI">/* n+1 */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">return</span> <span class="kw2">super</span>.<span class="me1">getTargetPage</span><span class="br0">&#40;</span>request, command, errors, currentPage<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</div>
<p>This solution is clean and makes your application more readable, your code more reusable and so on&#8230;</p>
<p>But what if the step we want to jump to is the final step? We cannot reach it by using the <a href="http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/web/portlet/mvc/AbstractWizardFormController.html#getTargetPage(javax.portlet.PortletRequest,%20java.lang.Object,%20org.springframework.validation.Errors,%20int)" target="_blank">getTargetPage</a> method because the final step has no page number assigned: the finish action is triggered by the request parameter <i>_finish</i> and the view name is retrieved by the ModelAndView object that the <a href="http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/web/portlet/mvc/AbstractWizardFormController.html#processFinish(javax.portlet.ActionRequest,%20javax.portlet.ActionResponse,%20java.lang.Object,%20org.springframework.validation.BindException)" target="_blank">processFinish</a> method returns.</p>
<p>To solve this problem we can modify the view name for target <i>n+1</i> at runtime by overriding the <a href="http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/web/portlet/mvc/AbstractWizardFormController.html#getViewName(javax.portlet.PortletRequest,%20java.lang.Object,%20int)" target="_blank">getViewName</a> method as following:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">protected</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> getViewName<span class="br0">&#40;</span>HttpServletRequest request, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AObject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Object</span></a> command, <span class="kw4">int</span> page<span class="br0">&#41;</span> <span class="br0">&#123;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>page == <span class="nu0">3</span> <span class="coMULTI">/* n+1 */</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; retun <span class="st0">&quot;redirect:myWizard.html?_finish=&quot;</span>; &nbsp;<span class="co1">// go to final step</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">return</span> <span class="kw2">super</span>.<span class="me1">getViewName</span><span class="br0">&#40;</span>request, command, page<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</div>
<p>In this way we simply redirect the flow to the final step. Obviously, at finish all pages get validated to guarantee a consistent state, so you cannot skip a step whose page needs validation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.francesco.iovine.name/blog/2009/07/22/how-to-skip-a-step-in-a-spring-abstractwizardformcontroller/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Spring AbstractWizardFormController, how to manipulate pages at runtime</title>
		<link>http://www.francesco.iovine.name/blog/2009/07/19/spring-abstractwizardformcontroller-how-to-manipulate-pages-at-runtime/</link>
		<comments>http://www.francesco.iovine.name/blog/2009/07/19/spring-abstractwizardformcontroller-how-to-manipulate-pages-at-runtime/#comments</comments>
		<pubDate>Sun, 19 Jul 2009 02:20:14 +0000</pubDate>
		<dc:creator>franciov</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.francesco.iovine.name/blog/?p=201</guid>
		<description><![CDATA[
The Abstract Wizard Form Controller is a form controller for typical wizard-style workflows, provided by Spring, a Java Web Application Framework.
In contrast to classic forms, wizards have more than one form view page.  Therefore, there are various actions instead of one single submit action:

finish: trying to leave the wizard successfully, i.e. performing its  [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.francesco.iovine.name/blog/wp-content/uploads/2009/07/spring-framework-2.5.png" alt="spring-framework-2.5" title="spring-framework-2.5" width="250" height="118" class="alignnone size-full wp-image-245" /><br />
The <a title="Spring Framework API 2.5" href="http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/web/portlet/mvc/AbstractWizardFormController.html" target="_blank">Abstract Wizard Form Controller</a> is a form controller for typical wizard-style workflows, provided by <a title="SpringSource.org" href="http://www.springsource.org/" target="_blank">Spring</a>, a Java Web Application Framework.</p>
<blockquote><p>In contrast to classic forms, wizards have more than one form view page.  Therefore, there are various actions instead of one single submit action:</p>
<ul>
<li>finish: trying to leave the wizard successfully, i.e. performing its  final action, and thus needing a valid state;</li>
<li>cancel: leaving the wizard without performing its final action, and  thus without regard to the validity of its current state;</li>
<li>page change: showing another wizard page, e.g. the next or previous  one, with regard to &#8220;dirty back&#8221; and &#8220;dirty forward&#8221;.</li>
</ul>
</blockquote>
<p>In this article I want to focus on pages, how to set them up, expecially in the uncommon situation in which you don&#8217;t know exactly the number of pages you want to put in your wizard before running the application.</p>
<p>Every Spring manual would suggest you to put WizardFormController&#8217;s pages in the Spring XML configuration file, and actually this is the best way to set up your pages. Let&#8217;s consider the following configuration:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="sc3"><span class="re1">&lt;bean</span> <span class="re0">name</span>=<span class="st0">&quot;myWizardForm&quot;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">class</span>=<span class="st0">&quot;forms.MyWizardForm&quot;</span><span class="re2">&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/bean<span class="re2">&gt;</span></span></span></p>
<p>&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;bean</span> <span class="re0">name</span>=<span class="st0">&quot;/myWizard.html&quot;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">class</span>=<span class="st0">&quot;control.MyWizardFormController&quot;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">p:sessionForm</span>=<span class="st0">&quot;true&quot;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">p:commandClass</span>=<span class="st0">&quot;forms.MyWizardForm&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">p:commandName</span>=<span class="st0">&quot;myWizardForm&quot;</span><span class="re2">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;property</span> <span class="re0">name</span>=<span class="st0">&quot;pages&quot;</span><span class="re2">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;list<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;value<span class="re2">&gt;</span></span></span>page0<span class="sc3"><span class="re1">&lt;/value<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;value<span class="re2">&gt;</span></span></span>page1<span class="sc3"><span class="re1">&lt;/value<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;value<span class="re2">&gt;</span></span></span>page2<span class="sc3"><span class="re1">&lt;/value<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/list<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/property<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/bean<span class="re2">&gt;</span></span></span></div>
</div>
<p>We have put a <i>property</i> named <i>pages</i> inside <i>myWizard.html</i> bean, in which we listed the page values. Each value is used as the name of the view inside your <i>jsp</i> folder.</p>
<p>And now the wizard form, you can set it up for your needs.</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">public</span> <span class="kw2">class</span> MyWizardForm <span class="br0">&#123;</span></p>
<p>&nbsp; &nbsp; <span class="co1">// put your fields here</span></p>
<p>&nbsp; &nbsp; <span class="kw2">public</span> MyWizardForm<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// initialization</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; <span class="co1">// put your setters and getters here</span><br />
<span class="br0">&#125;</span></div>
</div>
<p>Finally the wizard controller.</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">public</span> <span class="kw2">class</span> MyWizardFormController <span class="kw2">extends</span> AbstractWizardFormController <span class="br0">&#123;</span></p>
<p>&nbsp; &nbsp; <span class="kw2">public</span> MyWizardFormController<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; <span class="kw2">protected</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AMap+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Map</span></a> referenceData<span class="br0">&#40;</span>HttpServletRequest request, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AObject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Object</span></a> command, Errors errors, <span class="kw4">int</span> page<span class="br0">&#41;</span> <span class="kw2">throws</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AException+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Exception</span></a> <span class="br0">&#123;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AMap+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Map</span></a> map = <span class="kw2">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AHashMap+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">HashMap</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// put information you need into the map</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">return</span> map;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; <span class="kw2">protected</span> ModelAndView processFinish<span class="br0">&#40;</span>HttpServletRequest request, HttpServletResponse response, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AObject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Object</span></a> object, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ABindException+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">BindException</span></a> exception<span class="br0">&#41;</span> <span class="kw2">throws</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AException+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Exception</span></a> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">return</span> <span class="kw2">new</span> ModelAndView<span class="br0">&#40;</span><span class="st0">&quot;finish&quot;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</div>
<p>What if, for some reasons, you need to create or edit your wizard page list at runtime? Let&#8217;s face the problem.</p>
<p>First of all, you can override the XML configuration through the <a href="http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/web/portlet/mvc/AbstractWizardFormController.html#setPages(java.lang.String[])" target="_blank">setPages</a> method. The following example replaces the page list specified in the XML file with an identical one but that has been built at run-time in MyWizardFormController constructor.</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">public</span> MyWizardFormController<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> pages<span class="br0">&#91;</span><span class="br0">&#93;</span> = <span class="kw2">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a><span class="br0">&#91;</span><span class="nu0">3</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; pages<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span> = <span class="st0">&quot;page0&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; pages<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span> = <span class="st0">&quot;page1&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; pages<span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span> = <span class="st0">&quot;page2&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">this</span>.<span class="me1">setPages</span><span class="br0">&#40;</span>pages<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
</div>
<p>This doesn&#8217;t help much: we moved the configuration outside XML (that&#8217;s a bad thing) but we still have a fixed number of pages with fixed values.</p>
<p>Let&#8217;s consider an application in which the page values are the request parameter keys for the first step (i.e. _target0). We might call <a href="http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/web/portlet/mvc/AbstractWizardFormController.html#setPages(java.lang.String[])" target="_blank">setPages</a> inside an overridden method used before the wizard controller accesses to page list, such as the <a href="http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/web/portlet/mvc/AbstractWizardFormController.html#getInitialPage(javax.portlet.PortletRequest)" target="_blank">getInitialPage</a> method.</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">public</span> <span class="kw2">class</span> MyWizardFormController <span class="kw2">extends</span> AbstractWizardFormController <span class="br0">&#123;</span></p>
<p>&nbsp; &nbsp; <span class="kw2">public</span> MyWizardFormController<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; <span class="kw2">protected</span> <span class="kw4">int</span> getInitialPage<span class="br0">&#40;</span>HttpServletRequest request, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AObject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Object</span></a> command<span class="br0">&#41;</span> <span class="br0">&#123;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// override pages only when the target page is 0</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="kw2">this</span>.<span class="me1">getTargetPage</span><span class="br0">&#40;</span>request, <span class="nu0">0</span><span class="br0">&#41;</span> == <span class="nu0">0</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// retrieve keys from request parameters</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ASet+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Set</span></a> parameters = <span class="kw2">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AHashSet+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">HashSet</span></a><span class="br0">&#40;</span>request.<span class="me1">getParameterMap</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">keySet</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AIterator+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Iterator</span></a> parametersIterator = parameters.<span class="me1">iterator</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> pages<span class="br0">&#91;</span><span class="br0">&#93;</span> = <span class="kw2">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a><span class="br0">&#91;</span>parameters.<span class="me1">size</span><span class="br0">&#40;</span><span class="br0">&#41;</span> &#8211; <span class="nu0">1</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">int</span> i = <span class="nu0">0</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// fill wizard pages</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">while</span> <span class="br0">&#40;</span>parametersIterator.<span class="me1">hasNext</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> page = <span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a><span class="br0">&#41;</span> parametersIterator.<span class="me1">next</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// let&#8217;s ignore the &#8216;_target0&#8242; parameter key</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>page.<span class="me1">startsWith</span><span class="br0">&#40;</span><span class="st0">&quot;_&quot;</span><span class="br0">&#41;</span> == <span class="kw2">false</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pages<span class="br0">&#91;</span>i<span class="br0">&#93;</span> = page;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i++;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">this</span>.<span class="me1">setPages</span><span class="br0">&#40;</span>pages<span class="br0">&#41;</span>; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">return</span> <span class="kw2">super</span>.<span class="me1">getInitialPage</span><span class="br0">&#40;</span>request, command<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</div>
<p>In this way, as soon as <i>myWizard.html</i> bean is invoked by clicking on a link (i.e. GET http request) or submitting a form (i.e. POST http request), the page list is dinamically built starting from request parameter keys. This would be more useful if you decide to use request parameters values, or attributes.</p>
<p>For my purposes I used request parameter keys retrieved from a form submission in order to run an unordered set of pages and reporting each result (i.e. validation) in the final step.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.francesco.iovine.name/blog/2009/07/19/spring-abstractwizardformcontroller-how-to-manipulate-pages-at-runtime/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Nokia Ovi Store &#8211; Device and Application Heterogeneity</title>
		<link>http://www.francesco.iovine.name/blog/2009/07/03/nokia-ovi-store-device-and-application-heterogeneity/</link>
		<comments>http://www.francesco.iovine.name/blog/2009/07/03/nokia-ovi-store-device-and-application-heterogeneity/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 17:50:56 +0000</pubDate>
		<dc:creator>franciov</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[nokia]]></category>

		<guid isPermaLink="false">http://www.francesco.iovine.name/blog/?p=115</guid>
		<description><![CDATA[ 

Its name is Ovi Store, has been announced at the Mobile World Congress 2009 (Barcelona) in February, and on May 26 it went live for all Nokia users in the world. More than 50 Nokia devices were compatible with the service from day one and Nokia estimated that around 50 million people with Nokia [...]]]></description>
			<content:encoded><![CDATA[<p><span id="ucPreviewMsg_lblMessage" class="PreviewMsgText visualIEFloatFix"> </span></p>
<p><img class="size-medium wp-image-183 alignleft" title="nokia-ovi-logo" src="http://www.francesco.iovine.name/blog/wp-content/uploads/2009/07/nokia-ovi-logo-300x190.jpg" alt="nokia-ovi-logo" width="180" height="114" /></p>
<p>Its name is <a href="https://store.ovi.com/" target="_blank">Ovi Store</a>, has been announced at the <a href="http://www.mobileworldcongress.com/" target="_blank">Mobile World Congress</a> 2009 (Barcelona) in February, and on May 26 it went live for all Nokia users in the world. More than 50 Nokia devices were compatible with the service from day one and Nokia estimated that around 50 million people with Nokia devices would be able to benefit for Ovi Store. Initial number of applications was 20.000 and new applications creation is propelled by an high percentage of money going to developers. Moreover the Nokia N97 will be the first to come out with Ovi Store pre-installed.</p>
<p>The <a href="http://www.globalintelligence.com/group/" target="_blank">Global Intelligence Alliance Group</a> conducted an interesting <strong>analysis on  mobile market places</strong>. Different market places have been compared in terms of:</p>
<ol>
<li>time to market</li>
<li>the ability to attract developers</li>
<li>the rate of device adoption</li>
<li>an efficient interface and user experience</li>
<li>having a critical mass of attractive applications.</li>
</ol>
<p>to get the following rankings table:</p>
<table style="border: 1px solid; height: 313px;" border="0" width="500">
<tbody>
<tr>
<td style="border: 1px solid ; text-align: center">Application Marketplace</td>
<td style="border: 1px solid ; text-align: center"><strong>iPhone Apps Store </strong></td>
<td style="border: 1px solid ; text-align: center"><strong>Android Marketplace </strong></td>
<td style="border: 1px solid ; text-align: center"><strong>Ovi Apps Store</strong></td>
<td style="border: 1px solid ; text-align: center"><strong>Windows Mobile Skymarket </strong></td>
<td><strong>Blackberry Apps Storefront </strong></td>
<td><strong>webOS Software Store </strong></td>
</tr>
<tr>
<td style="border: 1px solid ; text-align: center">Manufacturer</td>
<td style="border: 1px solid ; text-align: center"><strong>Apple</strong></td>
<td style="border: 1px solid ; text-align: center"><strong>OHA</strong></td>
<td style="border: 1px solid ; text-align: center"><strong>Nokia</strong></td>
<td style="border: 1px solid ; text-align: center"><strong>Microsoft</strong></td>
<td style="border: 1px solid ; text-align: center"><strong>Research In Motion</strong></td>
<td style="border: 1px solid ; text-align: center"><strong>Palm</strong></td>
</tr>
<tr>
<td style="border: 1px solid ; text-align: center">Time to market</td>
<td style="border: 1px solid ; text-align: center">2</td>
<td style="border: 1px solid ; text-align: center">2</td>
<td style="border: 1px solid ; text-align: center">1</td>
<td style="border: 1px solid ; text-align: center">0</td>
<td style="border: 1px solid ; text-align: center">1</td>
<td style="border: 1px solid ; text-align: center">0</td>
</tr>
<tr>
<td style="border: 1px solid ; text-align: center">Attracting developers</td>
<td style="border: 1px solid ; text-align: center">2</td>
<td style="border: 1px solid ; text-align: center">2</td>
<td style="border: 1px solid ; text-align: center">2</td>
<td style="border: 1px solid ; text-align: center">1</td>
<td style="border: 1px solid ; text-align: center">2</td>
<td style="border: 1px solid ; text-align: center">1</td>
</tr>
<tr>
<td style="border: 1px solid ; text-align: center">Device adoption / rollout</td>
<td style="border: 1px solid ; text-align: center">1</td>
<td style="border: 1px solid ; text-align: center">0</td>
<td style="border: 1px solid ; text-align: center">2</td>
<td style="border: 1px solid ; text-align: center">2</td>
<td style="border: 1px solid ; text-align: center">1</td>
<td style="border: 1px solid ; text-align: center">0</td>
</tr>
<tr>
<td style="border: 1px solid ; text-align: center">Interface / user experience</td>
<td style="border: 1px solid ; text-align: center">2</td>
<td style="border: 1px solid ; text-align: center">2</td>
<td style="border: 1px solid ; text-align: center">2</td>
<td style="border: 1px solid ; text-align: center">1</td>
<td style="border: 1px solid ; text-align: center">1</td>
<td style="border: 1px solid ; text-align: center">2</td>
</tr>
<tr>
<td style="border: 1px solid ; text-align: center">Number, variety and appeal of apps</td>
<td style="border: 1px solid ; text-align: center">2</td>
<td style="border: 1px solid ; text-align: center">1</td>
<td style="border: 1px solid ; text-align: center">0</td>
<td style="border: 1px solid ; text-align: center">2</td>
<td style="border: 1px solid ; text-align: center">0</td>
<td style="border: 1px solid ; text-align: center">0</td>
</tr>
<tr>
<td style="border: 1px solid ; text-align: center"><strong> Summary</strong></td>
<td style="border: 1px solid ; text-align: center"><strong> 9</strong></td>
<td style="border: 1px solid ; text-align: center"><strong> 7</strong></td>
<td style="border: 1px solid ; text-align: center"><strong> 7</strong></td>
<td style="border: 1px solid ; text-align: center"><strong> 6</strong></td>
<td style="border: 1px solid ; text-align: center"><strong> 5</strong></td>
<td style="border: 1px solid ; text-align: center"><strong> 3</strong></td>
</tr>
</tbody>
</table>
<p>Source: Global Intelligence Alliance. Points are allocated as follows: 2 – strong, 1 – medium, 0 – weak based on assessment/expectations of all application stores along the parameters.</p>
<p>It&#8217;s interesting to note that Nokia&#8217;s rank is two points lower than iPhone Apps Store&#8217;s, but equal to Android Marketplace&#8217;s. Further information in the <a href="http://www.globalintelligence.com/insights-analysis/press-releases/2009/apple-emerges-ahead-of-oha-s-android-and-nokia-s-o/" target="_blank">Global Intelligence Alliance&#8217;s article</a>.</p>
<p>What distinguish Nokia Ovi Store from the other marketplaces is the <strong>device and application heterogeneity</strong> Nokia had to manage and offers. Despite iPhone Apps Store, that is clearly made for one phone, Nokia Ovi Store covers more than 50 Nokia devices, Series 40 and Series 60 included, and because of this for each mobile application the Ovi Store needs to indicate the device compatibility. Moreover, even if every application you can find inside the Ovi Store behaves and looks like it has been developed using the same technology, the same programming language, it doesn&#8217;t ! In fact, a Nokia application you download from Ovi Store might be:</p>
<ol>
<li>A Nokia Symbian Mobile Application</li>
<li>A Java Application (MIDlet)</li>
<li>A Nokia WRT Widget</li>
</ol>
<p>This might be seen as an advantage for the developer because she/he has the chance to choose the technology which likes more or which better fits to application features or customer requirements. And maybe it is, we&#8217;ll see what happens in the next few months.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.francesco.iovine.name/blog/2009/07/03/nokia-ovi-store-device-and-application-heterogeneity/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Software Architecture: Perspectives on a Maturing Discipline</title>
		<link>http://www.francesco.iovine.name/blog/2007/07/14/software-architecture-perspectives-on-a-maturing-discipline/</link>
		<comments>http://www.francesco.iovine.name/blog/2007/07/14/software-architecture-perspectives-on-a-maturing-discipline/#comments</comments>
		<pubDate>Sat, 14 Jul 2007 18:54:39 +0000</pubDate>
		<dc:creator>franciov</dc:creator>
		
		<guid isPermaLink="false">http://www.francesco.iovine.name/blog/2007/07/14/software-architecture-perspectives-on-a-maturing-discipline/</guid>
		<description><![CDATA[This is the title of the seminar held in Rome at the University &#8220;Tor Vergata&#8221;, on June 19 2007, by Philippe Kruchten, the Director of Process Development (RUP) at Rational Software (IBM) and Professor of Software Engineering at University of British Columbia in Vancouver, Canada.
It was a very interesting seminar due to the fact that [...]]]></description>
			<content:encoded><![CDATA[<p><img width="100" height="156" align="left" id="image110" alt="University of Rome Tor Vergata" src="http://www.francesco.iovine.name/blog/wp-content/uploads/2007/07/uniroma2.gif" />This is the title of the seminar held in Rome at the University &#8220;Tor Vergata&#8221;, on June 19 2007, by <a title="http://philippe.kruchten.com/" target="_blank" href="http://philippe.kruchten.com/">Philippe Kruchten</a>, the Director of Process Development (RUP) at Rational Software (IBM) and Professor of Software Engineering at University of British Columbia in Vancouver, Canada.</p>
<p>It was a very interesting seminar due to the fact that software architecture was still something vague for me (i.e. a computer engineering student much interested in software engineering but who has never handle with projects big enough to  need a significant effort in making the architecture).</p>
<p>In his seminar, first of all Kruchten tried to give <strong>a definition of <em>Software Architecture</em></strong> coming to the following conclusion:</p>
<blockquote><p>Software architecture encompasses the significant decisions about:</p>
<ul>
<li>the organization of a software system,</li>
<li>the selection of the structural elements and their interfaces by which the system is composed together with their behaviour as specified in the collaboration among those elements,</li>
<li>the composition of these elements into progressively larger subsystems,</li>
<li>the architectural syle that guides this organization, these elements and their interfaces, their collaborations, and their composition.</li>
</ul>
<p>Software architecture is not only concerned with structure and behaviour, but also with usage, functionality, performance, resilience, reuse, comprehensibility, economic and technological constraints and tradeoffs, and aesthetics.</p></blockquote>
<p>Although this definition of Software Architecture seems to be comprehensive, surely it is not so easy to understand at the first reading. <strong>A simpler definition</strong> could be the following:</p>
<blockquote><p>Architecture is about making decision.</p></blockquote>
<p>Then Kruchten focused on <strong>what architects actually do</strong>.</p>
<blockquote><p>The life of a software architect is a long (and sometimes painful) succession of suboptimal decisions made partly in the dark.</p></blockquote>
<p>Architects should spend their working time in the following manner:</p>
<ul>
<li>50% Architecting (design, validation, prototyping, documenting, etc.)</li>
<li>25% Getting input (from user requirement, other architecture, technology)</li>
<li>25% Providing Information (communicating architecture, assisting other stakeholders).</li>
</ul>
<p>The right balance among these activities is very important in order to not fall in typical situations in which architects don&#8217;t know anything about existing technology, or don&#8217;t communicate their work to designers.</p>
<p>It&#8217;s clear that <strong><em>decision</em></strong> is the key word for Software Architecture, therefore Decision Models, Decision Visualizations and Design Decision Capture Mechanisms are the key tools for architects. Refining models, languages and mechanisms concerning decisions is the purpose of Software Engineering Research in this area.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.francesco.iovine.name/blog/2007/07/14/software-architecture-perspectives-on-a-maturing-discipline/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Work Life Balance</title>
		<link>http://www.francesco.iovine.name/blog/2007/06/04/work-life-balance/</link>
		<comments>http://www.francesco.iovine.name/blog/2007/06/04/work-life-balance/#comments</comments>
		<pubDate>Mon, 04 Jun 2007 13:16:29 +0000</pubDate>
		<dc:creator>franciov</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://www.francesco.iovine.name/blog/2007/06/04/work-life-balance/</guid>
		<description><![CDATA[«If you ever admired those colleagues who stayed in office for more than 10 hours day by day, you should consider the fact that after a specific amount of work time bug rates increase dramatically and work results tend to reach lowest levels. Thus, working too hard for a long period of time could even [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>«If you ever admired those colleagues who stayed in office for more than 10 hours day by day, you should consider the fact that after a specific amount of work time bug rates increase dramatically and work results tend to reach lowest levels. Thus, working too hard for a long period of time could even have a negative effect.» <a title="Michael Stal's Blogger Page" href="http://stal.blogspot.com/2007/05/work-life-balance.html" target="_blank">Michael Stal</a></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.francesco.iovine.name/blog/2007/06/04/work-life-balance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
