Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Observer pattern in Python #3

Open
StoneyJackson opened this issue Dec 18, 2014 · 0 comments
Open

Observer pattern in Python #3

StoneyJackson opened this issue Dec 18, 2014 · 0 comments
Labels

Comments

@StoneyJackson
Copy link
Contributor

Or perhaps, how not to do an observer pattern in Python...

Abstract base-class Observable: https://git.gnome.org/browse/mousetrap/tree/src/mousetrap/core.py?h=gnome3-wip#n59
Concrete class Loop that implements Observable: https://git.gnome.org/browse/mousetrap/tree/src/mousetrap/core.py?h=gnome3-wip#n76
Plugin interface (observer): https://git.gnome.org/browse/mousetrap/tree/src/mousetrap/plugins/interface.py?h=gnome3-wip
Folder containing concrete observers: https://git.gnome.org/browse/mousetrap/tree/src/mousetrap/plugins?h=gnome3-wip

Might be useful to a data structures or design patterns course.

We are considering alternative implementations, including swapping it out for a system wide pub-sub-pattern: http://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants