<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Are there any benefits to getters and setters?</title>
	<atom:link href="http://ultravisual.co.uk/blog/2010/01/20/are-there-any-benefits-to-getters-and-setters/feed/" rel="self" type="application/rss+xml" />
	<link>http://ultravisual.co.uk/blog/2010/01/20/are-there-any-benefits-to-getters-and-setters/</link>
	<description>Flash, Flex and Actionscript coding.</description>
	<lastBuildDate>Sun, 16 Oct 2011 06:53:58 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
	<item>
		<title>By: xixixao</title>
		<link>http://ultravisual.co.uk/blog/2010/01/20/are-there-any-benefits-to-getters-and-setters/comment-page-1/#comment-2718</link>
		<dc:creator>xixixao</dc:creator>
		<pubDate>Wed, 29 Dec 2010 21:36:06 +0000</pubDate>
		<guid isPermaLink="false">http://ultravisual.co.uk/blog/?p=143#comment-2718</guid>
		<description>This is one thing I love about AS3, the set and get keywords. Because without them, using setters and getters (as in Java) really is pain even for the caller. And on the other hand, Java has threads for example (really lacking those in AS3).</description>
		<content:encoded><![CDATA[<p>This is one thing I love about AS3, the set and get keywords. Because without them, using setters and getters (as in Java) really is pain even for the caller. And on the other hand, Java has threads for example (really lacking those in AS3).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason Langdon</title>
		<link>http://ultravisual.co.uk/blog/2010/01/20/are-there-any-benefits-to-getters-and-setters/comment-page-1/#comment-2338</link>
		<dc:creator>Jason Langdon</dc:creator>
		<pubDate>Fri, 20 Aug 2010 00:09:54 +0000</pubDate>
		<guid isPermaLink="false">http://ultravisual.co.uk/blog/?p=143#comment-2338</guid>
		<description>For arguments sake, what if you wanted to set the htmlText property for your myCustomTextField?

The example you&#039;ve used can probably rely on the fact that the myCustomTextField is of type TextField, which obviously comes along with a whole swag of inherited public properties (of which htmlText and text are both included).

Perhaps a better example would have been to show some manipulation of the text within the text setter, or possibly even setting the htmlText field of the myCustomTextField object.

I agree with Iain on the many uses of getters/setters, frequently using them to create readonly properties and dispatch events notifying the rest of my application that a property has actually changed.

my 2 cents ;-)</description>
		<content:encoded><![CDATA[<p>For arguments sake, what if you wanted to set the htmlText property for your myCustomTextField?</p>
<p>The example you&#8217;ve used can probably rely on the fact that the myCustomTextField is of type TextField, which obviously comes along with a whole swag of inherited public properties (of which htmlText and text are both included).</p>
<p>Perhaps a better example would have been to show some manipulation of the text within the text setter, or possibly even setting the htmlText field of the myCustomTextField object.</p>
<p>I agree with Iain on the many uses of getters/setters, frequently using them to create readonly properties and dispatch events notifying the rest of my application that a property has actually changed.</p>
<p>my 2 cents <img src='http://ultravisual.co.uk/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sharedtut</title>
		<link>http://ultravisual.co.uk/blog/2010/01/20/are-there-any-benefits-to-getters-and-setters/comment-page-1/#comment-981</link>
		<dc:creator>Sharedtut</dc:creator>
		<pubDate>Wed, 03 Feb 2010 14:01:55 +0000</pubDate>
		<guid isPermaLink="false">http://ultravisual.co.uk/blog/?p=143#comment-981</guid>
		<description>Great article, thank you for putting all of this information together.</description>
		<content:encoded><![CDATA[<p>Great article, thank you for putting all of this information together.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Iain</title>
		<link>http://ultravisual.co.uk/blog/2010/01/20/are-there-any-benefits-to-getters-and-setters/comment-page-1/#comment-970</link>
		<dc:creator>Iain</dc:creator>
		<pubDate>Fri, 22 Jan 2010 11:55:16 +0000</pubDate>
		<guid isPermaLink="false">http://ultravisual.co.uk/blog/?p=143#comment-970</guid>
		<description>Agreed. I think what I really meant was that your example was possibly just too trivial to be worth implementing - but I understand you were just trying to give a simple example. I think real world uses are more illustrative. What I hate to see is a getter and setter for every variable for the sake of &quot;correctness&quot; with no real benefit.</description>
		<content:encoded><![CDATA[<p>Agreed. I think what I really meant was that your example was possibly just too trivial to be worth implementing &#8211; but I understand you were just trying to give a simple example. I think real world uses are more illustrative. What I hate to see is a getter and setter for every variable for the sake of &#8220;correctness&#8221; with no real benefit.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: UltraVisual</title>
		<link>http://ultravisual.co.uk/blog/2010/01/20/are-there-any-benefits-to-getters-and-setters/comment-page-1/#comment-969</link>
		<dc:creator>UltraVisual</dc:creator>
		<pubDate>Thu, 21 Jan 2010 21:40:34 +0000</pubDate>
		<guid isPermaLink="false">http://ultravisual.co.uk/blog/?p=143#comment-969</guid>
		<description>HI Iain,
Thanks for your comment.
The example I have posted here is only one reason to use getters and setters. They have many other uses which is what I was trying to get across, my example may of not been a perfect one for portraying this, but it is one that I have found to be very useful in the past in executing other methods once a variable is set. You are very right in listing other reasons to use getters / setters and I totally agree. As for your comment on breaking the single responsibilty principle - in my example definately not,  but as you say it would really depend on what else was going on in the class....but of course that is not discussed here.....</description>
		<content:encoded><![CDATA[<p>HI Iain,<br />
Thanks for your comment.<br />
The example I have posted here is only one reason to use getters and setters. They have many other uses which is what I was trying to get across, my example may of not been a perfect one for portraying this, but it is one that I have found to be very useful in the past in executing other methods once a variable is set. You are very right in listing other reasons to use getters / setters and I totally agree. As for your comment on breaking the single responsibilty principle &#8211; in my example definately not,  but as you say it would really depend on what else was going on in the class&#8230;.but of course that is not discussed here&#8230;..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Iain</title>
		<link>http://ultravisual.co.uk/blog/2010/01/20/are-there-any-benefits-to-getters-and-setters/comment-page-1/#comment-967</link>
		<dc:creator>Iain</dc:creator>
		<pubDate>Thu, 21 Jan 2010 18:19:25 +0000</pubDate>
		<guid isPermaLink="false">http://ultravisual.co.uk/blog/?p=143#comment-967</guid>
		<description>I&#039;m not convinced by your example here. You&#039;ve written a lot of code that you didn&#039;t previously need, for little advantage. I think you might be in danger of breaking the single responsibility principle - although that depends on what the main purpose of your class is meant to be.

I think better uses are:
 - when you need to define the variable in an interface
 - when you want to make a variable read-only
 - when you want to a value to be calculated each time it is requested
 - when you want to notify other methods / classes when the value is changed.</description>
		<content:encoded><![CDATA[<p>I&#8217;m not convinced by your example here. You&#8217;ve written a lot of code that you didn&#8217;t previously need, for little advantage. I think you might be in danger of breaking the single responsibility principle &#8211; although that depends on what the main purpose of your class is meant to be.</p>
<p>I think better uses are:<br />
 &#8211; when you need to define the variable in an interface<br />
 &#8211; when you want to make a variable read-only<br />
 &#8211; when you want to a value to be calculated each time it is requested<br />
 &#8211; when you want to notify other methods / classes when the value is changed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sixfngers</title>
		<link>http://ultravisual.co.uk/blog/2010/01/20/are-there-any-benefits-to-getters-and-setters/comment-page-1/#comment-964</link>
		<dc:creator>sixfngers</dc:creator>
		<pubDate>Thu, 21 Jan 2010 01:05:40 +0000</pubDate>
		<guid isPermaLink="false">http://ultravisual.co.uk/blog/?p=143#comment-964</guid>
		<description>not to mention error checking and validating data that comes through. Ex. your textfield should only have email addresses in it. When you try to enter a improperly formated string an error can occur and be handles in any number of ways.</description>
		<content:encoded><![CDATA[<p>not to mention error checking and validating data that comes through. Ex. your textfield should only have email addresses in it. When you try to enter a improperly formated string an error can occur and be handles in any number of ways.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tweets that mention Are there any benefits to getters and setters? &#124; UltraVisual Blog -- Topsy.com</title>
		<link>http://ultravisual.co.uk/blog/2010/01/20/are-there-any-benefits-to-getters-and-setters/comment-page-1/#comment-963</link>
		<dc:creator>Tweets that mention Are there any benefits to getters and setters? &#124; UltraVisual Blog -- Topsy.com</dc:creator>
		<pubDate>Wed, 20 Jan 2010 23:28:48 +0000</pubDate>
		<guid isPermaLink="false">http://ultravisual.co.uk/blog/?p=143#comment-963</guid>
		<description>[...] This post was mentioned on Twitter by HowDo.us, shane johnson. shane johnson said: new blog post http://bit.ly/4Q3EE8 my thoughts on getters and setters [...]</description>
		<content:encoded><![CDATA[<p>[...] This post was mentioned on Twitter by HowDo.us, shane johnson. shane johnson said: new blog post <a href="http://bit.ly/4Q3EE8" rel="nofollow">http://bit.ly/4Q3EE8</a> my thoughts on getters and setters [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

