<?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: Strategies For Global Data   ( hey it happens&#8230; )</title>
	<atom:link href="http://blog.alanklement.com/2010/02/10/strategies-for-global-data-hey-it-happens/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.alanklement.com/2010/02/10/strategies-for-global-data-hey-it-happens/</link>
	<description>Software Development</description>
	<lastBuildDate>Mon, 16 Jan 2012 04:16:26 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Ihsan</title>
		<link>http://blog.alanklement.com/2010/02/10/strategies-for-global-data-hey-it-happens/#comment-3549</link>
		<dc:creator>Ihsan</dc:creator>
		<pubDate>Sat, 17 Dec 2011 11:32:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.alanklement.com/?p=501#comment-3549</guid>
		<description>globals are evil for sloppy programmers. Basic assumption of new (28 yrs into programming) scripting languages are that programmers are a bunch of stupid idiots. That assumption may only hold true for the developers of these languages avoiding globals, table calls gotos and expression evaluators. It&#039;s explanation is complete laziness during compiler end runtime environment development thats all. Programming like that becomes sometimes like boxing with your one hand tied to your one foot. We are leaving more than %70 of cpu into spider webs, we are not harnessing the power of the computers just because of this lazy people. I just wrote a vm inside as3 vm just because of this. That solved a lot of problems. If it was not that popular, I would say as3 is just a piece of crap and leave it alone for rot.Remember : OOP and Structural programming are just programming approaches and there are other approaches which may fit to applications. As3 is a very and severely crippled oop.For instance as with the first assumption I indicated in the beginning it does not have support for destructors or onDestroy event propagation. I rewrote a system just to avoid this successfully. But why do I have to do all this? To make as3 work properly. Kick your gc adobe... And a lot of other weirdos in your sloppy code.</description>
		<content:encoded><![CDATA[<p>globals are evil for sloppy programmers. Basic assumption of new (28 yrs into programming) scripting languages are that programmers are a bunch of stupid idiots. That assumption may only hold true for the developers of these languages avoiding globals, table calls gotos and expression evaluators. It&#8217;s explanation is complete laziness during compiler end runtime environment development thats all. Programming like that becomes sometimes like boxing with your one hand tied to your one foot. We are leaving more than %70 of cpu into spider webs, we are not harnessing the power of the computers just because of this lazy people. I just wrote a vm inside as3 vm just because of this. That solved a lot of problems. If it was not that popular, I would say as3 is just a piece of crap and leave it alone for rot.Remember : OOP and Structural programming are just programming approaches and there are other approaches which may fit to applications. As3 is a very and severely crippled oop.For instance as with the first assumption I indicated in the beginning it does not have support for destructors or onDestroy event propagation. I rewrote a system just to avoid this successfully. But why do I have to do all this? To make as3 work properly. Kick your gc adobe&#8230; And a lot of other weirdos in your sloppy code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alan</title>
		<link>http://blog.alanklement.com/2010/02/10/strategies-for-global-data-hey-it-happens/#comment-643</link>
		<dc:creator>Alan</dc:creator>
		<pubDate>Thu, 11 Feb 2010 17:32:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.alanklement.com/?p=501#comment-643</guid>
		<description>The purpose of having the routine (method/function) is to allow arguments to be passed in.  This allows me to help contain and add some control to when/who modifies the data.

Having the data statically typed will help ensure that there is only one instance of it, but that won&#039;t help the epic fail that globals can portend.</description>
		<content:encoded><![CDATA[<p>The purpose of having the routine (method/function) is to allow arguments to be passed in.  This allows me to help contain and add some control to when/who modifies the data.</p>
<p>Having the data statically typed will help ensure that there is only one instance of it, but that won&#8217;t help the epic fail that globals can portend.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cm</title>
		<link>http://blog.alanklement.com/2010/02/10/strategies-for-global-data-hey-it-happens/#comment-642</link>
		<dc:creator>cm</dc:creator>
		<pubDate>Thu, 11 Feb 2010 16:58:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.alanklement.com/?p=501#comment-642</guid>
		<description>I&#039;m kinda confused here: 

So lets say you have a singleton called GLOBAL(.as)

Is it better to have a routine (getter/setter) to access the variables than have them staticly typed? 

E.g. GLOBAL.myVar vs GLOBAL.getVar()

I think a good point is &quot;statics are evil... when they puncture encapsulation&quot;</description>
		<content:encoded><![CDATA[<p>I&#8217;m kinda confused here: </p>
<p>So lets say you have a singleton called GLOBAL(.as)</p>
<p>Is it better to have a routine (getter/setter) to access the variables than have them staticly typed? </p>
<p>E.g. GLOBAL.myVar vs GLOBAL.getVar()</p>
<p>I think a good point is &#8220;statics are evil&#8230; when they puncture encapsulation&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Penner</title>
		<link>http://blog.alanklement.com/2010/02/10/strategies-for-global-data-hey-it-happens/#comment-640</link>
		<dc:creator>Robert Penner</dc:creator>
		<pubDate>Thu, 11 Feb 2010 02:40:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.alanklement.com/?p=501#comment-640</guid>
		<description>Ok, cool.</description>
		<content:encoded><![CDATA[<p>Ok, cool.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alan</title>
		<link>http://blog.alanklement.com/2010/02/10/strategies-for-global-data-hey-it-happens/#comment-639</link>
		<dc:creator>Alan</dc:creator>
		<pubDate>Thu, 11 Feb 2010 01:38:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.alanklement.com/?p=501#comment-639</guid>
		<description>@robert 
Sorry, I don&#039;t follow the bit about &quot;...add another constant and make a tripleton&quot;. The constants I have in the example are just a way to set a naming convention for passing arguments to the accessor method. I think I&#039;m missing something...

&quot;This doesn’t scale very well&quot; 

You&#039;re right it doesn&#039;t! I think I will go back and reword a bit of the article :) My point was really more of &#039;you&#039;re a coder on an app that *already* uses global data or &#039;you&#039;ve come into a project and there needs to be a quick fix.&#039; 

I see this technique as more of a &#039;damage control&#039; rather than a best practice. It&#039;s NOT meant to be scaled up at all. If anything it&#039;s a band-aid before a heavy refactor.</description>
		<content:encoded><![CDATA[<p>@robert<br />
Sorry, I don&#8217;t follow the bit about &#8220;&#8230;add another constant and make a tripleton&#8221;. The constants I have in the example are just a way to set a naming convention for passing arguments to the accessor method. I think I&#8217;m missing something&#8230;</p>
<p>&#8220;This doesn’t scale very well&#8221; </p>
<p>You&#8217;re right it doesn&#8217;t! I think I will go back and reword a bit of the article <img src='http://blog.alanklement.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  My point was really more of &#8216;you&#8217;re a coder on an app that *already* uses global data or &#8216;you&#8217;ve come into a project and there needs to be a quick fix.&#8217; </p>
<p>I see this technique as more of a &#8216;damage control&#8217; rather than a best practice. It&#8217;s NOT meant to be scaled up at all. If anything it&#8217;s a band-aid before a heavy refactor.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Penner</title>
		<link>http://blog.alanklement.com/2010/02/10/strategies-for-global-data-hey-it-happens/#comment-638</link>
		<dc:creator>Robert Penner</dc:creator>
		<pubDate>Thu, 11 Feb 2010 01:02:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.alanklement.com/?p=501#comment-638</guid>
		<description>Guice has singletons per injector, not per virtual machine. Same with injectors used by Robotlegs. You can create as many injectors as you like, each with its own set of singletons. 

http://groups.google.com/group/google-guice/browse_thread/thread/bf493035d428025b

Also, the singletons are not globally accessible. Some people say they are &quot;lower-case&quot; singletons rather than Singletons, which are global.</description>
		<content:encoded><![CDATA[<p>Guice has singletons per injector, not per virtual machine. Same with injectors used by Robotlegs. You can create as many injectors as you like, each with its own set of singletons. </p>
<p><a href="http://groups.google.com/group/google-guice/browse_thread/thread/bf493035d428025b" rel="nofollow">http://groups.google.com/group/google-guice/browse_thread/thread/bf493035d428025b</a></p>
<p>Also, the singletons are not globally accessible. Some people say they are &#8220;lower-case&#8221; singletons rather than Singletons, which are global.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Penner</title>
		<link>http://blog.alanklement.com/2010/02/10/strategies-for-global-data-hey-it-happens/#comment-637</link>
		<dc:creator>Robert Penner</dc:creator>
		<pubDate>Thu, 11 Feb 2010 00:57:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.alanklement.com/?p=501#comment-637</guid>
		<description>You&#039;ve made a doubleton. What happens when you want another model? You would add another constant and make a tripleton. This doesn&#039;t scale very well.

The problem lies in retrieving a model dependency with a static call:

var xml:XML = Data_Model.get_xml_formatted_for_images(Data_Model.XML_FORMAT_ONE);

This breaks the locality of the context and decreases flexibility. If a component needs data, pass it in. Don&#039;t have the component reach out to get it from a static API.

Imagine if a Flex List was hard-coded to retrieve its dataProvider from a static function. How would that be to work with?

You have a valid point about enums. Anything constant is fine as a static.</description>
		<content:encoded><![CDATA[<p>You&#8217;ve made a doubleton. What happens when you want another model? You would add another constant and make a tripleton. This doesn&#8217;t scale very well.</p>
<p>The problem lies in retrieving a model dependency with a static call:</p>
<p>var xml:XML = Data_Model.get_xml_formatted_for_images(Data_Model.XML_FORMAT_ONE);</p>
<p>This breaks the locality of the context and decreases flexibility. If a component needs data, pass it in. Don&#8217;t have the component reach out to get it from a static API.</p>
<p>Imagine if a Flex List was hard-coded to retrieve its dataProvider from a static function. How would that be to work with?</p>
<p>You have a valid point about enums. Anything constant is fine as a static.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Twitted by FlashArtOfWar</title>
		<link>http://blog.alanklement.com/2010/02/10/strategies-for-global-data-hey-it-happens/#comment-636</link>
		<dc:creator>Twitted by FlashArtOfWar</dc:creator>
		<pubDate>Wed, 10 Feb 2010 22:07:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.alanklement.com/?p=501#comment-636</guid>
		<description>[...] This post was Twitted by FlashArtOfWar [...]</description>
		<content:encoded><![CDATA[<p>[...] This post was Twitted by FlashArtOfWar [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

