>But bringing #sendAllSprites in to the equation is just confusing.

In a general discussion of OOP, yes. In my particular instance, I 
(cordially? ;-) disagree. I was giving an example of an exception where 
exposing a behavior's properties might be acceptable.

On a larger scale, I completely agree that you should access objects 
through accessor methods, not through properties. In fact, that was really 
the thrust of my message.

Ok, maybe my exception was confusing because I didn't go into much depth in 
the description of my program. In my particular case, the 44 other sprites 
are the *only* other sprites on the screen, except for one large background 
(with no behaviors). They have all the same behavior attached to them, and 
it's the only behavior attached. So a sendAllSprites command only goes to 
the target behaviors anyway.

I cited it because it's a variation on OOP--in many ways, a very pure OOP 
application, because you have 44 instances of the same script, even though 
none of them was created with the "new" function. Each sprite is a 
self-aware, self-contained object, yet I saw a compelling reason to expose 
the main sprite's position properties.

>  "sendAllSprites" is slow because you access other objects through a 
> multiple inheritance relation to a sprite-object.

Yes, I understand that. Good point, though.

>  What would be a fair comparison would be to use <call #mMethod, 
> plistOfBehaviors]>

Hmm... that's a new syntax for me. I assume plistOfBehaviors is a list of 
the instance references of all 44 sprites? Maybe I can learn 
something  here. How would that be faster than sendAllSprites?

>I'll just reiterate: "sendAllSprites" is great for picking up object 
>references at initialization, typically from "beginsprite" or 
>"prepareFrame" events.

Precisely why I didn't use it :-)

Cordially,
Kerry Thompson
Learning Network


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to