<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Weak listeners are bad</title>
	<link>http://www.tyz.nl/2010/09/28/weak-listeners-are-bad/</link>
	<description>Flash Developer</description>
	<pubDate>Sat, 19 May 2012 07:03:23 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>

	<item>
		<title>By: Thijs</title>
		<link>http://www.tyz.nl/2010/09/28/weak-listeners-are-bad/#comment-15208</link>
		<author>Thijs</author>
		<pubDate>Tue, 19 Jul 2011 10:06:52 +0000</pubDate>
		<guid>http://www.tyz.nl/2010/09/28/weak-listeners-are-bad/#comment-15208</guid>
		<description>@Rackdoll: Thanks for your reply. But the difference between the GC and the Temple is that you can't control the GC, but you can control the Temple! The Temple doesn't destruct your objects automatically,  it just destruct the objects if you first call the destruct() method. The Temple helps you destructing the object by removing all the event listeners. So this is absolutely not the same as how the GC works.

And if you don't clean your event listeners, you probably don't want to clean them, unless you are just a lazy programmer.

And this CG hinting you mention is only available for FP11, which is still in beta. So not many of the visitors will have this. So relaying on this would be silly. Till then you just can't relay on the GC. You can never tell if or when the GC is running. So you can never tell for sure if an listener will react on an Event.</description>
		<content:encoded><![CDATA[<p>@Rackdoll: Thanks for your reply. But the difference between the GC and the Temple is that you can&#8217;t control the GC, but you can control the Temple! The Temple doesn&#8217;t destruct your objects automatically,  it just destruct the objects if you first call the destruct() method. The Temple helps you destructing the object by removing all the event listeners. So this is absolutely not the same as how the GC works.</p>
<p>And if you don&#8217;t clean your event listeners, you probably don&#8217;t want to clean them, unless you are just a lazy programmer.</p>
<p>And this CG hinting you mention is only available for FP11, which is still in beta. So not many of the visitors will have this. So relaying on this would be silly. Till then you just can&#8217;t relay on the GC. You can never tell if or when the GC is running. So you can never tell for sure if an listener will react on an Event.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rackdoll</title>
		<link>http://www.tyz.nl/2010/09/28/weak-listeners-are-bad/#comment-15186</link>
		<author>Rackdoll</author>
		<pubDate>Mon, 18 Jul 2011 15:22:16 +0000</pubDate>
		<guid>http://www.tyz.nl/2010/09/28/weak-listeners-are-bad/#comment-15186</guid>
		<description>I totally do not agree on this post.

Your argument was that if you use weak references you depend on the GC....
But using Temple framework for cleaning listeners..... thats just repositioning the scope of cleaning.... meaning now your own framework does it and your are dependant on that...
So thats actually same same..

Also.
Using weak references is actually a good thing, because:
If you dont clean it... aka forget to clean/remove it...... the GC will do it for you.
This is a solid approuch.. where as not using weak references and depending solely on  self removing ... is less solid thus bad practice.

so. I guess using them IS better.
Also the new FP 11 will have CG hinting which will make it even more reliable to use weakreferences.

;)</description>
		<content:encoded><![CDATA[<p>I totally do not agree on this post.</p>
<p>Your argument was that if you use weak references you depend on the GC&#8230;.<br />
But using Temple framework for cleaning listeners&#8230;.. thats just repositioning the scope of cleaning&#8230;. meaning now your own framework does it and your are dependant on that&#8230;<br />
So thats actually same same..</p>
<p>Also.<br />
Using weak references is actually a good thing, because:<br />
If you dont clean it&#8230; aka forget to clean/remove it&#8230;&#8230; the GC will do it for you.<br />
This is a solid approuch.. where as not using weak references and depending solely on  self removing &#8230; is less solid thus bad practice.</p>
<p>so. I guess using them IS better.<br />
Also the new FP 11 will have CG hinting which will make it even more reliable to use weakreferences.</p>
<p> <img src='http://www.tyz.nl/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ted</title>
		<link>http://www.tyz.nl/2010/09/28/weak-listeners-are-bad/#comment-12263</link>
		<author>Ted</author>
		<pubDate>Wed, 23 Mar 2011 23:17:40 +0000</pubDate>
		<guid>http://www.tyz.nl/2010/09/28/weak-listeners-are-bad/#comment-12263</guid>
		<description>Thanks man that is great.</description>
		<content:encoded><![CDATA[<p>Thanks man that is great.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thijs</title>
		<link>http://www.tyz.nl/2010/09/28/weak-listeners-are-bad/#comment-12228</link>
		<author>Thijs</author>
		<pubDate>Tue, 22 Mar 2011 10:53:47 +0000</pubDate>
		<guid>http://www.tyz.nl/2010/09/28/weak-listeners-are-bad/#comment-12228</guid>
		<description>@Ted: We currently using CS5, that why all .fla files are CS5. But I just made a compatibility update to CS3. So you can open and run all examples in CS3, CS4 and CS5.

Version 2.8.6 is now available at GoogleCode: http://code.google.com/p/templelibrary/</description>
		<content:encoded><![CDATA[<p>@Ted: We currently using CS5, that why all .fla files are CS5. But I just made a compatibility update to CS3. So you can open and run all examples in CS3, CS4 and CS5.</p>
<p>Version 2.8.6 is now available at GoogleCode: <a href="http://code.google.com/p/templelibrary/" rel="nofollow">http://code.google.com/p/templelibrary/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ted</title>
		<link>http://www.tyz.nl/2010/09/28/weak-listeners-are-bad/#comment-12225</link>
		<author>Ted</author>
		<pubDate>Tue, 22 Mar 2011 09:34:23 +0000</pubDate>
		<guid>http://www.tyz.nl/2010/09/28/weak-listeners-are-bad/#comment-12225</guid>
		<description>I cannot open the example .fla's for Temple Library in CS4 - are they all in CS5?</description>
		<content:encoded><![CDATA[<p>I cannot open the example .fla&#8217;s for Temple Library in CS4 - are they all in CS5?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thijs</title>
		<link>http://www.tyz.nl/2010/09/28/weak-listeners-are-bad/#comment-9735</link>
		<author>Thijs</author>
		<pubDate>Sun, 28 Nov 2010 19:40:32 +0000</pubDate>
		<guid>http://www.tyz.nl/2010/09/28/weak-listeners-are-bad/#comment-9735</guid>
		<description>@Mani: just added an example of the FormXMLService. I hope this makes the use of a FormService more clear:

http://templelibrary.googlecode.com/svn/trunk/examples/index.html#FormXMLService</description>
		<content:encoded><![CDATA[<p>@Mani: just added an example of the FormXMLService. I hope this makes the use of a FormService more clear:</p>
<p><a href="http://templelibrary.googlecode.com/svn/trunk/examples/index.html#FormXMLService" rel="nofollow">http://templelibrary.googlecode.com/svn/trunk/examples/index.html#FormXMLService</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thijs</title>
		<link>http://www.tyz.nl/2010/09/28/weak-listeners-are-bad/#comment-9649</link>
		<author>Thijs</author>
		<pubDate>Wed, 24 Nov 2010 16:29:11 +0000</pubDate>
		<guid>http://www.tyz.nl/2010/09/28/weak-listeners-are-bad/#comment-9649</guid>
		<description>@Mani: thanks for your comment. We have plans to make a more detailed and extended example of the Form en the FormServices. But we are very busy at the moment, so I can't give you any dates for this.

But I like that you are using the Temple. And if you have any problems or questions, please let us know, so we can improve our Temple Library. You can use the issue tracker on Google code ( http://code.google.com/p/templelibrary/issues/list ), for bugs and feature requests or Google groups ( http://groups.google.com/group/templelibrary ) for questions.</description>
		<content:encoded><![CDATA[<p>@Mani: thanks for your comment. We have plans to make a more detailed and extended example of the Form en the FormServices. But we are very busy at the moment, so I can&#8217;t give you any dates for this.</p>
<p>But I like that you are using the Temple. And if you have any problems or questions, please let us know, so we can improve our Temple Library. You can use the issue tracker on Google code ( <a href="http://code.google.com/p/templelibrary/issues/list" rel="nofollow">http://code.google.com/p/templelibrary/issues/list</a> ), for bugs and feature requests or Google groups ( <a href="http://groups.google.com/group/templelibrary" rel="nofollow">http://groups.google.com/group/templelibrary</a> ) for questions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mani</title>
		<link>http://www.tyz.nl/2010/09/28/weak-listeners-are-bad/#comment-9646</link>
		<author>mani</author>
		<pubDate>Wed, 24 Nov 2010 12:36:11 +0000</pubDate>
		<guid>http://www.tyz.nl/2010/09/28/weak-listeners-are-bad/#comment-9646</guid>
		<description>Slightly OT, but I just wanted to say great work with Temple Library! I'm awed at the effort and thoroughness of the code, and simply releasing it as an Open Source effort is amazingly philanthropic.
I'm looking forward to some more documentation, though. Currently struggling with a site that uses a whole load of forms, and while the front-end interface is nicely and intuitively handled by the Form examples that you've posted, the actual processing, sending and receiving/parsing is harder to follow.
Not an enormous problem, as I'll brew my own. But just a pity that I can't use your implementation, as it would definitely be better!</description>
		<content:encoded><![CDATA[<p>Slightly OT, but I just wanted to say great work with Temple Library! I&#8217;m awed at the effort and thoroughness of the code, and simply releasing it as an Open Source effort is amazingly philanthropic.<br />
I&#8217;m looking forward to some more documentation, though. Currently struggling with a site that uses a whole load of forms, and while the front-end interface is nicely and intuitively handled by the Form examples that you&#8217;ve posted, the actual processing, sending and receiving/parsing is harder to follow.<br />
Not an enormous problem, as I&#8217;ll brew my own. But just a pity that I can&#8217;t use your implementation, as it would definitely be better!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thijs</title>
		<link>http://www.tyz.nl/2010/09/28/weak-listeners-are-bad/#comment-8967</link>
		<author>Thijs</author>
		<pubDate>Fri, 08 Oct 2010 17:11:44 +0000</pubDate>
		<guid>http://www.tyz.nl/2010/09/28/weak-listeners-are-bad/#comment-8967</guid>
		<description>@Thomas: that's because you set the listener on the object itself. So there is no reference to an other object, so the Garbage Collector can remove the object.</description>
		<content:encoded><![CDATA[<p>@Thomas: that&#8217;s because you set the listener on the object itself. So there is no reference to an other object, so the Garbage Collector can remove the object.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas</title>
		<link>http://www.tyz.nl/2010/09/28/weak-listeners-are-bad/#comment-8965</link>
		<author>Thomas</author>
		<pubDate>Fri, 08 Oct 2010 10:39:07 +0000</pubDate>
		<guid>http://www.tyz.nl/2010/09/28/weak-listeners-are-bad/#comment-8965</guid>
		<description>There is only one exception for using weak listeners: adding listeners to the stage. Since the stage will never be disposed and the only reference to an object is the reference to the stage, there is no need for this object to exist. But still you have to remove this (weak) listener when this object should be disposed!


I'm not sur with that, if you do it : 

function MyMovieClip () 
{
   addEventListener( Event.ADDED_TO_STAGE, _addedToStage );
}

when the object MyMovieClip is set to null, the listener will be cleaned,</description>
		<content:encoded><![CDATA[<p>There is only one exception for using weak listeners: adding listeners to the stage. Since the stage will never be disposed and the only reference to an object is the reference to the stage, there is no need for this object to exist. But still you have to remove this (weak) listener when this object should be disposed!</p>
<p>I&#8217;m not sur with that, if you do it : </p>
<p>function MyMovieClip ()<br />
{<br />
   addEventListener( Event.ADDED_TO_STAGE, _addedToStage );<br />
}</p>
<p>when the object MyMovieClip is set to null, the listener will be cleaned,</p>
]]></content:encoded>
	</item>
</channel>
</rss>

