On Sat, Oct 4, 2014 at 6:59 AM, Daniel Gillet <[email protected]>
wrote:

> Hi Claudio,
>
> Thanks a lot for your elaborate answer. I like very much the idea of
> overriding the __setattr__ method in order to add our signaling process.
> I'm just curious to know why you recommend using a third-party library like
> blinker instead of Pyglet EventDispatcher class. It there a performance
> issue?
>

Flexibility is the main reason.

pyglet publish-subscribe goes by the design "objects that can accept
listeners and dispatch messages to them", which means
    - you must ensure the publisher is instantiated before any listener
    - you must carry a reference to the publisher instance to any point
when you want to subscribe

blinker goes by the design of "named channels to which publishers and
listeners can attach" , so
    - any instantiation order will work
    - to subscribe you only need the channel name, which often is a
constant in the app design, so no need to carry around.



> Something I would like to get in Cocos is Kivy Properties
> http://kivy.org/docs/api-kivy.properties.html
>
> With what you provided, I could probably come up with something like that.
>
>
Sounds interesting, but keep an eye over performance. Intercepting the
__setattr__ is probably fine for the use cases of debugging and scene
editor, but may be unbearable for an app cpu-starved


> Cheers,
> Daniel.
>

cheers,
claudio

--

-- 
You received this message because you are subscribed to the Google Groups 
"cocos2d discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cocos-discuss.
For more options, visit https://groups.google.com/d/optout.

Reply via email to