<?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: MXMLC WTF (5)</title>
	<atom:link href="http://blog.iconara.net/2007/03/11/mxmlc-wtf-5/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.iconara.net/2007/03/11/mxmlc-wtf-5/</link>
	<description></description>
	<pubDate>Tue, 06 Jan 2009 11:56:09 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Flora</title>
		<link>http://blog.iconara.net/2007/03/11/mxmlc-wtf-5/comment-page-1/#comment-4620</link>
		<dc:creator>Flora</dc:creator>
		<pubDate>Fri, 06 Jul 2007 18:31:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.iconara.net/2007/03/11/mxmlc-wtf-5/#comment-4620</guid>
		<description>&lt;p&gt;Fair enough, this is such a simple case, and you may ask why bother with trying to adhere so strictly to encapsulation and whatnot? To be honest, I would have been perfectly happy with non-internal getters, or even public instance variables to solve this, but that’s not the point of this article.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Fair enough, this is such a simple case, and you may ask why bother with trying to adhere so strictly to encapsulation and whatnot? To be honest, I would have been perfectly happy with non-internal getters, or even public instance variables to solve this, but that’s not the point of this article.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Spike</title>
		<link>http://blog.iconara.net/2007/03/11/mxmlc-wtf-5/comment-page-1/#comment-3339</link>
		<dc:creator>Spike</dc:creator>
		<pubDate>Mon, 12 Mar 2007 16:35:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.iconara.net/2007/03/11/mxmlc-wtf-5/#comment-3339</guid>
		<description>&lt;p&gt;If you're concerned about a maintainable interface, why don't you just create an internal scoped setter function that doesn't use the implicit set keyword?&lt;/p&gt;

&lt;p&gt;That satisfies the maintainable interface requirement without needing to create an additional class. That would probably be a lot easier for anyone maintaining the code to understand without needing an explanation in the comments of both classes. A simple one line comment above the function should do it:&lt;/p&gt;

&lt;p&gt;// No implicit setter because of public/internal compiler scoping bug&lt;/p&gt;

&lt;p&gt;I appreciate that you're just pointing out that the compiler is being stupid, and I agree with you. It just feels like your workaround is a little more cumbersome than it needs to be.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>If you&#8217;re concerned about a maintainable interface, why don&#8217;t you just create an internal scoped setter function that doesn&#8217;t use the implicit set keyword?</p>

<p>That satisfies the maintainable interface requirement without needing to create an additional class. That would probably be a lot easier for anyone maintaining the code to understand without needing an explanation in the comments of both classes. A simple one line comment above the function should do it:</p>

<p>// No implicit setter because of public/internal compiler scoping bug</p>

<p>I appreciate that you&#8217;re just pointing out that the compiler is being stupid, and I agree with you. It just feels like your workaround is a little more cumbersome than it needs to be.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Theo</title>
		<link>http://blog.iconara.net/2007/03/11/mxmlc-wtf-5/comment-page-1/#comment-3337</link>
		<dc:creator>Theo</dc:creator>
		<pubDate>Mon, 12 Mar 2007 07:37:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.iconara.net/2007/03/11/mxmlc-wtf-5/#comment-3337</guid>
		<description>&lt;p&gt;I did consider that solution, but in my opinion it falls in the category "other less elegant work-around[s]".&lt;/p&gt;

&lt;p&gt;The reason for this is that you will couple your code to an instance variable, which cannot later be made into a property (without considerable ugliness).&lt;/p&gt;

&lt;p&gt;One of the only good aspects of properties is that you can start with instance variables and add logic as you go without breaking the interface, by referencing the instance variable directly you have side stepped that.&lt;/p&gt;

&lt;p&gt;Fair enough, this is such a simple case, and you may ask why bother with trying to adhere so strictly to encapsulation and whatnot? To be honest, I would have been perfectly happy with non-internal getters, or even public instance variables to solve this, but that's not the point of this article.&lt;/p&gt;

&lt;p&gt;The point is to show that the mxmlc compiler cannot handle this situation, and that that can cause problems. In another example, there may not be a quick and dirty work-around.&lt;/p&gt;

&lt;p&gt;I'm sorry if I come off a little bit harsh, I do belive your intention to be good.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I did consider that solution, but in my opinion it falls in the category &#8220;other less elegant work-around[s]&#8220;.</p>

<p>The reason for this is that you will couple your code to an instance variable, which cannot later be made into a property (without considerable ugliness).</p>

<p>One of the only good aspects of properties is that you can start with instance variables and add logic as you go without breaking the interface, by referencing the instance variable directly you have side stepped that.</p>

<p>Fair enough, this is such a simple case, and you may ask why bother with trying to adhere so strictly to encapsulation and whatnot? To be honest, I would have been perfectly happy with non-internal getters, or even public instance variables to solve this, but that&#8217;s not the point of this article.</p>

<p>The point is to show that the mxmlc compiler cannot handle this situation, and that that can cause problems. In another example, there may not be a quick and dirty work-around.</p>

<p>I&#8217;m sorry if I come off a little bit harsh, I do belive your intention to be good.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Spike</title>
		<link>http://blog.iconara.net/2007/03/11/mxmlc-wtf-5/comment-page-1/#comment-3332</link>
		<dc:creator>Spike</dc:creator>
		<pubDate>Sun, 11 Mar 2007 23:17:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.iconara.net/2007/03/11/mxmlc-wtf-5/#comment-3332</guid>
		<description>&lt;p&gt;That's an interesting issue, but there's a much simples workaround for the specific example you give here:&lt;/p&gt;

&lt;p&gt;internal var _largeImageUrl : String;&lt;/p&gt;

&lt;p&gt;public function get largeImageUrl( ) : String {
    return _largeImageUrl;
}&lt;/p&gt;

&lt;p&gt;As long as you don't need to do anything in the setter other than set the internal value, you can just make the varible internal rather than private and dispense with the implicit setter completely.&lt;/p&gt;

&lt;p&gt;If you need to do something more complex in the setter, that's a different story and you'd have to go with something like what you suggested.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>That&#8217;s an interesting issue, but there&#8217;s a much simples workaround for the specific example you give here:</p>

<p>internal var _largeImageUrl : String;</p>

<p>public function get largeImageUrl( ) : String {
    return _largeImageUrl;
}</p>

<p>As long as you don&#8217;t need to do anything in the setter other than set the internal value, you can just make the varible internal rather than private and dispense with the implicit setter completely.</p>

<p>If you need to do something more complex in the setter, that&#8217;s a different story and you&#8217;d have to go with something like what you suggested.</p>]]></content:encoded>
	</item>
</channel>
</rss>
