bonobo and interface inheritance issue



Hi folks:

I have a question/issue if someone needs a momentary distraction from
controversy->consensus-building ;-)

It seems to me that the only way for bonobo components (at least those
based on bonobo-object.c) to implement an IDL interface that is a
subclass of another is if the implementing bonobo object is itself
inherited from a bonobo object which implements the parent class: thus

BonoboParentClass implements IDLinterface
BonoboChildClass implements extendedIDLinterface

where the IDL relationship is:

  interface extendedIDLinterface : IDLinterface { ... };

Now, since CORBA is just about interfaces, a CORBA object doesn't
inherit any implementation.  But it seems in bonobo that
implementations *are* inherited, and in fact since GObject does not
(yet??) support overriding of fps in the vtable, the result seems to
be that the inherited implementations (from the bonobo parent class)
are not overridable.

Of course I am fairly new to this and could be missing something
obvious.

Obvious or not, I hope I am missing "something" since I really have a
use for IDL subinterfaces, but have not yet figured out how to specify
the epv tables for parent class methods in the fooparent_class_init()
functions.  My initial impression is that the epvs for parent classes
(in the class struct) are shared with the parent type, thus not
overridable.  It secondly seems that only the new methods (those not
in the parent IDL) can be specified in the bonobo class init func, the
parent IDLs implementations seem to require that a bonobo parent class
exist which fills in the appropriate epv.  

I suppose that if this is so, perhaps a workaround is to create two
implementation classes (in bonobo) for the same parent IDL, and
inherit from one of those for the subclass.  But this seems very
kludgy, is there a better way? 

I hope I have reasonably clear in what I need to do, if not please ask
for more details...

Best regards, TIA

-Bill

P.S. - as an afterthought I give more specifics of my use case, for
any interested parties:
(slightly stripped down):

Listener.idl: describes a simple event listener, with one method,
notifyEvent

Registry.idl: inherits from listener, but also registers other
listeners and relays notifications to them, has a
registerClientListener method.

bonobo class ListenerClass can specify the notifyEvent implementation
bonobo class RegistryClass can specify the registerClientListener
implementation

however it seems that RegistryClass cannot specify the notifyEvent
method since it's in the parent interface's epv

furthermore if RegistryClass inherits from ListenerClass it will have
a notifyEvent method pointer but there appears to be no way to
override that method.

??
-- 
--------------
Bill Haneman
Gnome Accessibility / Batik SVG Toolkit
Sun Microsystems Ireland




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]