Stephan Bergmann wrote:
Darragh Sherwin wrote:

Hi Stephan


One case where this problem occurs in practice is with
com.sun.star.lang.XComponent and
com.sun.star.document.XEventBroadcaster.  I just learned that Andreas
Schlüns is probably going to add a new
com.sun.star.document.XDocumentEventBroadcaster (or similar) that will
have the same functionality as XEventBroadcaster, but using method names
that do not clash with XComponent.  Thus, in this specific case the
solution can be to inherit from XDocumentEventBroadcaster instead of
XEventBroadcaster (which you might still want to offer via the
query-interface mechanism on your objects, for backwards compatibility),
instead of using the general solution outlined above.



I am slightly disturbed by this, 2 interfaces with the same function names.
Has any consideration being given to language-bindings that do not use
the query-interface mechanism ? I.e pyuno where all interfaces for a
service are returned ? How would pyuno or language_bindings that do not
use the query-interface mechanism resolve which method to use?

Regards,


I have no idea how pyuno does it. But note that this problem was there from the beginning, and has nothing to do with the addition of multiple-inheritance interfaces. There are, for example, already cases where one UNO object implements both XComponent and XEventBroadcaster, and I have no idea how pyuno handles a call to addEventListener on such an object. However, since this problem is there from the beginning, I assume that the designers of pyuno took care of that in an appropriate manner.

On second thought, all "dynamic" UNO language bindings (where statically you can call any method of any UNO interface that a given UNO object supports on that object, without mentioning the specific interface, and where dynamically the runtime dispatches the method call to the correct interface) are broken: A method call (with whatever actual syntax)

  someUnoObj#foo()

will work as long as the UNO object referenced by someUnoObj only implements one interface that defines method foo, but will fail as soon as that object also implements another such interface.

:(

-Stephan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to