Greetings, all, from Denver. I've been following along with class since moving back, and got to thinking about Singletons and event dispatchers.
It seems a global event dispatcher could be a good idea, since there's only one to 'keep track' of. However, it seems many apps don't use this - they set up different dispatchers for custom events that different objects would be interested in.
I'm interested to hear if
1) anyone has used a singleton implementation of an event dispatcher
2) what you think the pros and cons of doing so would be
Things I can think of -
One pro - obviously, a centralized place that events useful to objects across an app can be dispatched
One con - in a very large application, you could start having collisions in terms of custom event names (ie, how many things do you need to keep track of that are all clicked on, using a similar click event).
I think that using a singleton disptacher or multiple dispatchers depends on, like everything else, the needs of your particular project.
Unrelated attachment... the recipe to the chocolate/almond candies I brought in December!
Signing off from the Mile High City!
Tags:
Share
- Attachments:
-
-
▶ Reply to This