<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Flex Part 02+: A Better Model Object</title>
	<atom:link href="http://blog.tsclausing.com/post/24/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.tsclausing.com/post/24</link>
	<description>Personal &#38; Professional Blog of T. Scot Clausing // Adobe Flex Consultant in Nashville, TN</description>
	<pubDate>Sun, 01 Aug 2010 05:21:35 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: T. Scot Clausing</title>
		<link>http://blog.tsclausing.com/post/24#comment-253</link>
		<dc:creator>T. Scot Clausing</dc:creator>
		<pubDate>Wed, 17 Dec 2008 14:47:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tsclausing.com/post/24#comment-253</guid>
		<description>Sure.  And in most cases that is probably the quickest way to get up and running and may be entirely sufficient for your project.  I just like to keep the VO's as light as possible for remoting.

&lt;strong&gt;Value Object:&lt;/strong&gt; Represents only the data (values) that are persisted or retrieved.

&lt;strong&gt;Model Object:&lt;/strong&gt; Enforces business rules through accessor methods, handles copying and comparing custom object equality, and may contain convenience methods for various tasks (like a getter for "fullName" that returns a concatenated first and last name).

There's no right or wrong way to do it - just personal preference.</description>
		<content:encoded><![CDATA[<p>Sure.  And in most cases that is probably the quickest way to get up and running and may be entirely sufficient for your project.  I just like to keep the VO&#8217;s as light as possible for remoting.</p>
<p><strong>Value Object:</strong> Represents only the data (values) that are persisted or retrieved.</p>
<p><strong>Model Object:</strong> Enforces business rules through accessor methods, handles copying and comparing custom object equality, and may contain convenience methods for various tasks (like a getter for &#8220;fullName&#8221; that returns a concatenated first and last name).</p>
<p>There&#8217;s no right or wrong way to do it - just personal preference.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: prashanth</title>
		<link>http://blog.tsclausing.com/post/24#comment-249</link>
		<dc:creator>prashanth</dc:creator>
		<pubDate>Tue, 16 Dec 2008 17:51:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tsclausing.com/post/24#comment-249</guid>
		<description>Hi,
   Can't the Model Object and Value Object be the same Object? We can define say the phone accessor in VO as well. Is there a reasoning to use VO and convert it to Model object?</description>
		<content:encoded><![CDATA[<p>Hi,<br />
   Can&#8217;t the Model Object and Value Object be the same Object? We can define say the phone accessor in VO as well. Is there a reasoning to use VO and convert it to Model object?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gordon</title>
		<link>http://blog.tsclausing.com/post/24#comment-190</link>
		<dc:creator>Gordon</dc:creator>
		<pubDate>Sun, 02 Nov 2008 11:13:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tsclausing.com/post/24#comment-190</guid>
		<description>Hi.

I think I  follow the logic of this "better" method. And your example at 
http://blog.tsclausing.com/post/9 was really, really, really useful to me as a flex noobie. However, I don't quite see how this "better" way of doing models would work in actual code. Maybe it is that I am still fuzzy on setters and getters. Can you provide an example of the model locator code where you use the SimpleSchool model instead of the School model? Just something that shows the setters and getters working and value object properties emerging in the code. 

Everything else has been great in this series. Reading your first example of Value Objects and the table row analogy was a total "Aha" moment for me. Keep up the good work.</description>
		<content:encoded><![CDATA[<p>Hi.</p>
<p>I think I  follow the logic of this &#8220;better&#8221; method. And your example at<br />
<a href="http://blog.tsclausing.com/post/9" rel="nofollow">http://blog.tsclausing.com/post/9</a> was really, really, really useful to me as a flex noobie. However, I don&#8217;t quite see how this &#8220;better&#8221; way of doing models would work in actual code. Maybe it is that I am still fuzzy on setters and getters. Can you provide an example of the model locator code where you use the SimpleSchool model instead of the School model? Just something that shows the setters and getters working and value object properties emerging in the code. </p>
<p>Everything else has been great in this series. Reading your first example of Value Objects and the table row analogy was a total &#8220;Aha&#8221; moment for me. Keep up the good work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Derek Basch</title>
		<link>http://blog.tsclausing.com/post/24#comment-138</link>
		<dc:creator>Derek Basch</dc:creator>
		<pubDate>Tue, 22 Apr 2008 18:14:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tsclausing.com/post/24#comment-138</guid>
		<description>I was bugged by the inability to enumerate static Value Objects too. I found a good solution here:

http://www.lynchconsulting.com.au/blog/index.cfm/2008/2/6/AS3--Looping-over-properties-of-a-class

flash.util.describeType() returns an XML Object with static members and can be nicely enumerated.</description>
		<content:encoded><![CDATA[<p>I was bugged by the inability to enumerate static Value Objects too. I found a good solution here:</p>
<p><a href="http://www.lynchconsulting.com.au/blog/index.cfm/2008/2/6/AS3--Looping-over-properties-of-a-class" rel="nofollow">http://www.lynchconsulting.com.au/blog/index.cfm/2008/2/6/AS3&#8211;Looping-over-properties-of-a-class</a></p>
<p>flash.util.describeType() returns an XML Object with static members and can be nicely enumerated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: T. Scot Clausing</title>
		<link>http://blog.tsclausing.com/post/24#comment-113</link>
		<dc:creator>T. Scot Clausing</dc:creator>
		<pubDate>Mon, 24 Mar 2008 01:50:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tsclausing.com/post/24#comment-113</guid>
		<description>Yes.  I actually have updated code for this post.  I'll post it as soon as I can - (on vacation for a couple days).</description>
		<content:encoded><![CDATA[<p>Yes.  I actually have updated code for this post.  I&#8217;ll post it as soon as I can - (on vacation for a couple days).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dsissoko</title>
		<link>http://blog.tsclausing.com/post/24#comment-112</link>
		<dc:creator>dsissoko</dc:creator>
		<pubDate>Sun, 23 Mar 2008 21:48:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tsclausing.com/post/24#comment-112</guid>
		<description>Thanks thor this post.
i'm interested in the solution for the issue about RemoteClass meta data usage.
Can you post some sample code for the toVO and fromVO methods ?</description>
		<content:encoded><![CDATA[<p>Thanks thor this post.<br />
i&#8217;m interested in the solution for the issue about RemoteClass meta data usage.<br />
Can you post some sample code for the toVO and fromVO methods ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: T. Scot Clausing</title>
		<link>http://blog.tsclausing.com/post/24#comment-35</link>
		<dc:creator>T. Scot Clausing</dc:creator>
		<pubDate>Sat, 23 Feb 2008 19:58:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tsclausing.com/post/24#comment-35</guid>
		<description>&lt;strong&gt;Note:&lt;/strong&gt; 
If your Value Objects use &lt;code&gt;RemoteClass&lt;/code&gt; meta data (to map to a server side VO), the &lt;code&gt;toVO()&lt;/code&gt; method may simply return the result of &lt;code&gt;ObjectUtil.copy(_vo)&lt;/code&gt;.  However, the &lt;code&gt;fromVO()&lt;/code&gt; implementation will need to change.  

&lt;code&gt;fromVO()&lt;/code&gt; needs an array of property names which can be either obtained with &lt;code&gt;ObjectUtil.getClassInfo(vo).properties&lt;/code&gt; OR you will need to declare a private static array in the Model Object which holds an array of the VO's property names.  The &lt;code&gt;fromVO()&lt;/code&gt; method will loop through the values in the array instead of using &lt;code&gt;ObjectUtil.copy()&lt;/code&gt; implementation shown above.

When using meta data to map to a server side object, &lt;code&gt;ObjectUtil.copy()&lt;/code&gt; returns a normal class instance instead of a dynamic &lt;code&gt;Object&lt;/code&gt; class instance.  Only dynamically added properties can be looped through in the way shown above.  If you would like to see an example, let me know!  I still very much favor this solution.</description>
		<content:encoded><![CDATA[<p><strong>Note:</strong><br />
If your Value Objects use <code>RemoteClass</code> meta data (to map to a server side VO), the <code>toVO()</code> method may simply return the result of <code>ObjectUtil.copy(_vo)</code>.  However, the <code>fromVO()</code> implementation will need to change.  </p>
<p><code>fromVO()</code> needs an array of property names which can be either obtained with <code>ObjectUtil.getClassInfo(vo).properties</code> OR you will need to declare a private static array in the Model Object which holds an array of the VO&#8217;s property names.  The <code>fromVO()</code> method will loop through the values in the array instead of using <code>ObjectUtil.copy()</code> implementation shown above.</p>
<p>When using meta data to map to a server side object, <code>ObjectUtil.copy()</code> returns a normal class instance instead of a dynamic <code>Object</code> class instance.  Only dynamically added properties can be looped through in the way shown above.  If you would like to see an example, let me know!  I still very much favor this solution.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
