<?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: To use getters/setters or not to user getters/setters, oh what a question&#8230;</title>
	<atom:link href="http://www.sdfug.org/san-diego-flash-users-group/actionscript-30/to-use-getterssetters-or-not-to-user-getterssetter-oh-what-a-question/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sdfug.org/san-diego-flash-users-group/actionscript-30/to-use-getterssetters-or-not-to-user-getterssetter-oh-what-a-question/</link>
	<description>San Diego Flash Users Group</description>
	<pubDate>Thu, 16 Oct 2008 07:23:49 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Kyle</title>
		<link>http://www.sdfug.org/san-diego-flash-users-group/actionscript-30/to-use-getterssetters-or-not-to-user-getterssetter-oh-what-a-question/#comment-235</link>
		<dc:creator>Kyle</dc:creator>
		<pubDate>Thu, 31 Jul 2008 16:17:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.sdfug.org/san-diego-flash-users-group/actionscript-30/to-use-getterssetters-or-not-to-user-getterssetter-oh-what-a-question/#comment-235</guid>
		<description>Generally you don't want your value objects to be sending out any notifications. Value objects are supposed to be "dumb" and do nothing more than provide a predefined interface for storing data. What you'd want to do in this case is have the controller update the model (in this case your VO), then send an update notification to any interested parties (such as the view) to let them know the model has been updated, at that point the view would grab the updated data from the model (again, your VO) and make alterations as needed.</description>
		<content:encoded><![CDATA[<p>Generally you don&#8217;t want your value objects to be sending out any notifications. Value objects are supposed to be &#8220;dumb&#8221; and do nothing more than provide a predefined interface for storing data. What you&#8217;d want to do in this case is have the controller update the model (in this case your VO), then send an update notification to any interested parties (such as the view) to let them know the model has been updated, at that point the view would grab the updated data from the model (again, your VO) and make alterations as needed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephen Buckley</title>
		<link>http://www.sdfug.org/san-diego-flash-users-group/actionscript-30/to-use-getterssetters-or-not-to-user-getterssetter-oh-what-a-question/#comment-234</link>
		<dc:creator>Stephen Buckley</dc:creator>
		<pubDate>Thu, 31 Jul 2008 09:36:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.sdfug.org/san-diego-flash-users-group/actionscript-30/to-use-getterssetters-or-not-to-user-getterssetter-oh-what-a-question/#comment-234</guid>
		<description>What about if you have a value object which store a set of properties for a view and needs to notify the view if a value changes?

The fact that you can dispatch an event if the data changes</description>
		<content:encoded><![CDATA[<p>What about if you have a value object which store a set of properties for a view and needs to notify the view if a value changes?</p>
<p>The fact that you can dispatch an event if the data changes</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Limmy</title>
		<link>http://www.sdfug.org/san-diego-flash-users-group/actionscript-30/to-use-getterssetters-or-not-to-user-getterssetter-oh-what-a-question/#comment-124</link>
		<dc:creator>Limmy</dc:creator>
		<pubDate>Thu, 01 May 2008 20:46:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.sdfug.org/san-diego-flash-users-group/actionscript-30/to-use-getterssetters-or-not-to-user-getterssetter-oh-what-a-question/#comment-124</guid>
		<description>I'm just looking forward to ActionScript 5.0. The whole getter/setter argument will be taken care of, trust me. I'm not allowed to tell you any more than that, cos it's top secret.</description>
		<content:encoded><![CDATA[<p>I&#8217;m just looking forward to ActionScript 5.0. The whole getter/setter argument will be taken care of, trust me. I&#8217;m not allowed to tell you any more than that, cos it&#8217;s top secret.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kyle</title>
		<link>http://www.sdfug.org/san-diego-flash-users-group/actionscript-30/to-use-getterssetters-or-not-to-user-getterssetter-oh-what-a-question/#comment-109</link>
		<dc:creator>Kyle</dc:creator>
		<pubDate>Thu, 10 Apr 2008 20:39:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.sdfug.org/san-diego-flash-users-group/actionscript-30/to-use-getterssetters-or-not-to-user-getterssetter-oh-what-a-question/#comment-109</guid>
		<description>This is great guys, I'm really diggin the back and forth and hearing everyones thoughts and ideas! Keep em coming!</description>
		<content:encoded><![CDATA[<p>This is great guys, I&#8217;m really diggin the back and forth and hearing everyones thoughts and ideas! Keep em coming!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: walpolea</title>
		<link>http://www.sdfug.org/san-diego-flash-users-group/actionscript-30/to-use-getterssetters-or-not-to-user-getterssetter-oh-what-a-question/#comment-108</link>
		<dc:creator>walpolea</dc:creator>
		<pubDate>Thu, 10 Apr 2008 17:23:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.sdfug.org/san-diego-flash-users-group/actionscript-30/to-use-getterssetters-or-not-to-user-getterssetter-oh-what-a-question/#comment-108</guid>
		<description>Darron is right about AS3's way of implementing getters and setters, it's really just the long way around setting a property. However, take a look at C++ and you'll see a hundred good uses for getter and setters. With function and operator overloading, templated classes, pointers and uber-strict data typing conventions, C++ is the sort of language that originated the idea of getters and setters.

AS3 implements getter/setters the way they do because if you are performing mutation or validation on setting/getting a value, the nomenclature for getting/setting a value doesn't change.

this.myprop = "Blah";

this code could be using a setter, or could be setting a public property, but the nice thing is, whoever is using my class doesn't need to know there is a difference. I would hate it if half of a class's properties were public and half had to be get/set using a function (as is done in C++).

this.myprop = "Blah;
this.setOtherProp("Blah"); //annoying</description>
		<content:encoded><![CDATA[<p>Darron is right about AS3&#8217;s way of implementing getters and setters, it&#8217;s really just the long way around setting a property. However, take a look at C++ and you&#8217;ll see a hundred good uses for getter and setters. With function and operator overloading, templated classes, pointers and uber-strict data typing conventions, C++ is the sort of language that originated the idea of getters and setters.</p>
<p>AS3 implements getter/setters the way they do because if you are performing mutation or validation on setting/getting a value, the nomenclature for getting/setting a value doesn&#8217;t change.</p>
<p>this.myprop = &#8220;Blah&#8221;;</p>
<p>this code could be using a setter, or could be setting a public property, but the nice thing is, whoever is using my class doesn&#8217;t need to know there is a difference. I would hate it if half of a class&#8217;s properties were public and half had to be get/set using a function (as is done in C++).</p>
<p>this.myprop = &#8220;Blah;<br />
this.setOtherProp(&#8221;Blah&#8221;); //annoying</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: enefekt</title>
		<link>http://www.sdfug.org/san-diego-flash-users-group/actionscript-30/to-use-getterssetters-or-not-to-user-getterssetter-oh-what-a-question/#comment-103</link>
		<dc:creator>enefekt</dc:creator>
		<pubDate>Thu, 10 Apr 2008 00:47:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.sdfug.org/san-diego-flash-users-group/actionscript-30/to-use-getterssetters-or-not-to-user-getterssetter-oh-what-a-question/#comment-103</guid>
		<description>I liked Darron's approach too when I read that post.
You can always seamlessly change them to setter/getters later if you need to.

The other thing is that if you're writing an interface and not a class, then you can't use public variables, but you can use getters and setters.</description>
		<content:encoded><![CDATA[<p>I liked Darron&#8217;s approach too when I read that post.<br />
You can always seamlessly change them to setter/getters later if you need to.</p>
<p>The other thing is that if you&#8217;re writing an interface and not a class, then you can&#8217;t use public variables, but you can use getters and setters.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kyle</title>
		<link>http://www.sdfug.org/san-diego-flash-users-group/actionscript-30/to-use-getterssetters-or-not-to-user-getterssetter-oh-what-a-question/#comment-102</link>
		<dc:creator>Kyle</dc:creator>
		<pubDate>Wed, 09 Apr 2008 23:52:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.sdfug.org/san-diego-flash-users-group/actionscript-30/to-use-getterssetters-or-not-to-user-getterssetter-oh-what-a-question/#comment-102</guid>
		<description>I agree with you on the fact that there are instance when you would want to use them (ex: validation, as I mentioned in my post); however, if you are doing nothing more than taking an argument and storing it in a property there is no difference between using a public property and using a private property with a getter/setter. I guess my main point is that if you have a class with a lot of properties that being set in this fashion, you can save a significant amount of file size by sticking with public properties. If you need validation later, then simply add the get/set methods then...</description>
		<content:encoded><![CDATA[<p>I agree with you on the fact that there are instance when you would want to use them (ex: validation, as I mentioned in my post); however, if you are doing nothing more than taking an argument and storing it in a property there is no difference between using a public property and using a private property with a getter/setter. I guess my main point is that if you have a class with a lot of properties that being set in this fashion, you can save a significant amount of file size by sticking with public properties. If you need validation later, then simply add the get/set methods then&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Bryant</title>
		<link>http://www.sdfug.org/san-diego-flash-users-group/actionscript-30/to-use-getterssetters-or-not-to-user-getterssetter-oh-what-a-question/#comment-101</link>
		<dc:creator>Steve Bryant</dc:creator>
		<pubDate>Wed, 09 Apr 2008 18:17:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.sdfug.org/san-diego-flash-users-group/actionscript-30/to-use-getterssetters-or-not-to-user-getterssetter-oh-what-a-question/#comment-101</guid>
		<description>I have to disagree here.

Take the example of a birth date. You may want to do some validation on that birth date. If it is a public property, you can't.

This would mean that "fred" could be set as the birth date, which isn't even the right type. It could also mean that the birth date could be a valid date, but in the future.

You might also have properties for which you don't think you need any validation but for which you might later discover that you do have such a need.

Better to use getters and setters up front then later discover such a problem.</description>
		<content:encoded><![CDATA[<p>I have to disagree here.</p>
<p>Take the example of a birth date. You may want to do some validation on that birth date. If it is a public property, you can&#8217;t.</p>
<p>This would mean that &#8220;fred&#8221; could be set as the birth date, which isn&#8217;t even the right type. It could also mean that the birth date could be a valid date, but in the future.</p>
<p>You might also have properties for which you don&#8217;t think you need any validation but for which you might later discover that you do have such a need.</p>
<p>Better to use getters and setters up front then later discover such a problem.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
