AS3 - Does the amount of code in an object matter for multiple instances?
<p>What's better?</p>

<p>1000 objects with 500 lines of code each</p>

<p>vs</p>

<p>1000 objects with 30 lines of code each that delegate to one manager with 500 lines of code.</p>

<p><br></p>

<p>Context:</p>

<p>I have signals in my game. Dozens and dozens of them. I like that they have better performance than the native Flash Event.</p>

<p>I figured that as I was going to have so many, they should be lightweight, so each signal only stores a few variables and three methods.</p>

<p>Variables: head, tail, isStepping, hasColdNodes, signalMgr</p>

<p>Methods: addListener, removeListener, dispatch</p>

<p><br>
But all these signals delegate the heavywork to the signalMgr, as in:</p>

<p>signalMgr.addListener(this, listener, removeOnFirstCallback);</p>

<p>That manager handles all the doublylinked list stuff, and has much more code than a signal.</p>

<p>So, is it correct to think this way?
I figure that if I had all the management code in the signal, that would be repeated in memory every time I instance one.</p>