[Zope3-Users] Override subscribers
Marius Gedminas
mgedmin at b4net.lt
Sun Feb 17 13:02:14 EST 2008
On Sun, Feb 17, 2008 at 09:21:24AM +0100, Kai Diefenbach wrote:
> is there a way to override subscriber?
No, unfortunately.
> My scenario is as follows:
>
> There is an object. If it has been initialized some subscribers are
> called (via IObjectInitializedEvent).
>
> class SomeObject:
> implements(ISomeObject)
>
> There is an extended object:
>
> class ISomeExtendedObject(ISomeObject)
>
> class SomeExtendedObject(SomeObject):
> implements(ISomeExtendedObject)
>
> Some subscribers needn't be called after SomeExtendedObject has been
> initialized.
I would suggest you restructure your class/interface hierarchy so that
I/SomeExtendedObject doesn't inherit from I/SomeObject directly, but instead
inherits from a common abstract base interface/class.
I think it's called the dependency inversion principle of object-oriented
design.
Marius Gedminas
--
The difference between Microsoft and 'Jurassic Parc':
In one, a mad businessman makes a lot of money with beasts that should be
extinct.
The other is a film.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope3-users/attachments/20080217/6783fca1/attachment.bin
More information about the Zope3-users
mailing list