<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.4" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Improving Cairngorm&#8217;s ModelLocator Part 2 - Hiding the singleton</title>
	<link>http://www.bigroom.co.uk/blog/improving-cairngorms-modellocator-part-2/</link>
	<description>Actionscript developer, consultant and troubleshooter</description>
	<pubDate>Fri, 21 Nov 2008 06:28:46 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.4</generator>

	<item>
		<title>by: richard</title>
		<link>http://www.bigroom.co.uk/blog/improving-cairngorms-modellocator-part-2/#comment-27225</link>
		<pubDate>Thu, 17 Apr 2008 14:23:32 +0000</pubDate>
		<guid>http://www.bigroom.co.uk/blog/improving-cairngorms-modellocator-part-2/#comment-27225</guid>
					<description>There was line in the Model code above that said

&lt;code&gt;return _data[name] &#124;&#124; name;&lt;/code&gt;

This should say

&lt;code&gt;return _data[name] &#124;&#124; null;&lt;/code&gt;

I've changed it above but if you grabbed the code before now, you need to make this change or it won't work with non-string data types.</description>
		<content:encoded><![CDATA[<p>There was line in the Model code above that said</p>
<p><code>return _data[name] || name;</code></p>
<p>This should say</p>
<p><code>return _data[name] || null;</code></p>
<p>I&#8217;ve changed it above but if you grabbed the code before now, you need to make this change or it won&#8217;t work with non-string data types.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: richard</title>
		<link>http://www.bigroom.co.uk/blog/improving-cairngorms-modellocator-part-2/#comment-27223</link>
		<pubDate>Tue, 15 Apr 2008 16:50:26 +0000</pubDate>
		<guid>http://www.bigroom.co.uk/blog/improving-cairngorms-modellocator-part-2/#comment-27223</guid>
					<description>Hi Jason

Memory may be a problem. This technique is something I only thought of yesterday, so it's very possible that under testing it will have issues.

I'd really prefer to get the monostate working from &lt;a href="http://www.bigroom.co.uk/blog/improving-cairngorms-modellocator" rel="nofollow" rel="nofollow"&gt;yesterday's post&lt;/a&gt;, but can't find the right solution. It probably requires delving deeper into the binding code and creating the bindings by hand.</description>
		<content:encoded><![CDATA[<p>Hi Jason</p>
<p>Memory may be a problem. This technique is something I only thought of yesterday, so it&#8217;s very possible that under testing it will have issues.</p>
<p>I&#8217;d really prefer to get the monostate working from <a href="http://www.bigroom.co.uk/blog/improving-cairngorms-modellocator" rel="nofollow" rel="nofollow">yesterday&#8217;s post</a>, but can&#8217;t find the right solution. It probably requires delving deeper into the binding code and creating the bindings by hand.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Jason</title>
		<link>http://www.bigroom.co.uk/blog/improving-cairngorms-modellocator-part-2/#comment-27221</link>
		<pubDate>Tue, 15 Apr 2008 16:15:42 +0000</pubDate>
		<guid>http://www.bigroom.co.uk/blog/improving-cairngorms-modellocator-part-2/#comment-27221</guid>
					<description>Do you worry about memory consumption much with this method?  If you have a very large model locater (say 2000 properties), and every class that wants to access the model locater needs to make a new instance I can see memory consumption rising.  I see that you are just pointing to the same instance of the model for each new instance of ModelLocator, but there is still a memory cost in creating all of the bindings for each new instance of ModelLocator.

If I have a standard medium-sized Cairngorm app that has 50 views, and 100 events, commands, and delegates and every command needs to set a flag in the model and every delegate needs to set response data in the model, and every view needs a reference to the model obviously -- that is 250 instances of ModelLocator - now you could clean up those instances and do due diligence with your memory management, but it seems like a candidate for a memory leak, or at least barrier to scaling.</description>
		<content:encoded><![CDATA[<p>Do you worry about memory consumption much with this method?  If you have a very large model locater (say 2000 properties), and every class that wants to access the model locater needs to make a new instance I can see memory consumption rising.  I see that you are just pointing to the same instance of the model for each new instance of ModelLocator, but there is still a memory cost in creating all of the bindings for each new instance of ModelLocator.</p>
<p>If I have a standard medium-sized Cairngorm app that has 50 views, and 100 events, commands, and delegates and every command needs to set a flag in the model and every delegate needs to set response data in the model, and every view needs a reference to the model obviously &#8212; that is 250 instances of ModelLocator - now you could clean up those instances and do due diligence with your memory management, but it seems like a candidate for a memory leak, or at least barrier to scaling.
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
