| Home | Trees | Index | Help |
|---|
| Package ocempgui :: Package events :: Module IObserver :: Class IObserver |
|
object --+
|
IObserver
IObserver () -> IObserver
A class matching a observer interface of the observer pattern.
The IObserver class is an interface, that should be implemented by
classes, that should be able to register themselves on concrete
Subject implementations. It declares a single method, update(),
which receives the state change details of the Subject.
A short example for reacting upon state changes of Subject:
class MyObserver (IObserver):
...
def update (self, subject, attribute, oldval, newval):
# Look for the certain subject.
if subject == 'UniqueSubjectName':
# Which state changed?
if attribute == 'value':
self.do_some_action (oldval, newval)
...
| Method Summary | |
|---|---|
I.update (...) -> None | |
| Inherited from object | |
x.__init__(...) initializes x; see x.__class__.__doc__ for signature | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
x.__repr__() <==> repr(x) | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) | |
| Method Details |
|---|
update(self, subject, prop, oldval, newval)I.update (...) -> None Notifies the IObserver about a state change of a certain Subject. This method has to be implemented by inherited classes. Its signature matches the basic requirements of the Subject class. |
| Home | Trees | Index | Help |
|---|
| Generated by Epydoc 2.1 on Thu Jan 10 10:18:44 2008 | http://epydoc.sf.net |