<?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>Obecto Training Portal &#187; refactore</title>
	<atom:link href="http://training.obecto.com/tag/refactore/feed/" rel="self" type="application/rss+xml" />
	<link>http://training.obecto.com</link>
	<description>sharing our knowledge</description>
	<lastBuildDate>Wed, 07 Apr 2010 08:57:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>MVC Example &#8211; Refactored</title>
		<link>http://training.obecto.com/2009/07/mvc-example-refactored/</link>
		<comments>http://training.obecto.com/2009/07/mvc-example-refactored/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 15:17:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[VMware Flex]]></category>
		<category><![CDATA[model adapter]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[refactore]]></category>

		<guid isPermaLink="false">http://training.obecto.com/?p=270</guid>
		<description><![CDATA[DOWNLOAD REFACTORED VERSION OF THE MVC EXAMPLE
What&#8217;s included in the re-factored version?

the MVC approach in now demonstrated not only for the module, but also for the item renderer used in the list component
the model adapter pattern is demonstrated too
some other minor refinements

Adapting the Model into a Presentation Model
Let&#8217;s see the Model Adapter pattern in more [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://training.obecto.com/wp-content/uploads/2009/05/mvcexamplerefactored.zip">DOWNLOAD REFACTORED VERSION OF THE MVC EXAMPLE</a></p>
<p>What&#8217;s included in the re-factored version?</p>
<ul>
<li>the MVC approach in now demonstrated not only for the module, but also for the item renderer used in the list component</li>
<li>the model adapter pattern is demonstrated too</li>
<li>some other minor refinements</li>
</ul>
<h3>Adapting the Model into a Presentation Model</h3>
<p>Let&#8217;s see the Model Adapter pattern in more detail:</p>
<p>The MXML usage of the model adapter is pretty straight-forward &#8211; you can see this in the <em>StatisticsView.mxml</em>:</p>
<pre class="prettyprint" style="font-size: 12px; overflow: auto;">
&lt;programmerListItemModel:ProgrammerListItemModelAdapter id="modelAdapter"
    source="{model.programmers}"/&gt;
</pre>
<p>And then instead of using the <i>model.programmers</i> you can use <i>modelAdapter.resultCollection</i>:</p>
<pre class="prettyprint" style="font-size: 12px; overflow: auto;">
&lt;list:CustomLayoutList id="list" styleName="programmersList" width="550"
    layout="{model.inAdvancedView ? verticalLayout : fluidLayout}"
    dataProvider="{modelAdapter.resultCollection}"
    itemRenderer="{new ClassFactory(ProgrammerListItem)}"/&gt;
</pre>
<p>This adaptation is actually in a way demonstration of what means to have a pure abstract model and a presentation model (like in the MVP pattern).</p>
]]></content:encoded>
			<wfw:commentRss>http://training.obecto.com/2009/07/mvc-example-refactored/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
