Rony G. Flatscher wrote:
>
> Mathias Bauer wrote:
>
>>>E.g., in the ooRexx support for UNO/OOo the connection-routine looks like:
>>>
>>>------------- cut here -------------
>>>::routine UNO.connect public
>>> parse arg unoURL -- retrieve the argument, if any
>>>
>>> xContext=.UNO~Bootstrap~bootstrap -- get an initialized local UNO
>>> runtime environment
>>>
>>> if unoURL="" then -- no unoURL given, use default (local installation)
>>> return xContext -- return the context object (which can be used to get
>>> the service manager)
>>>
>>> -- use the received unoURL to establish a connection to the remote
>>> object
>>> uur=
>>> xContext~getServiceManager~createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver",
>>> xContext)
>>> remoteObject = uur~XUnoUrlResolver ~resolve(unoURL) -- get the
>>> connection
>>> return remoteObject
>>>
>>>------------- cut here -------------
>>>
>>>Looking at the code (the tilde is the message operator, i.e. left of it
>>>is the receiving object, right of it the name of the message), there is
>>>no queryInterface() at all. However, wherever the name of an interface
>>>is used as a message name (like at the end of the code snippet, the
>>>message "XUnoUrlResolver"), the "under the covers" support will carry
>>>out the queryInterface().
>>>
>>>
>>
>>Exactly that's what more or less what OOo Basic does. I agree that this
>>is a very good compromise: it allows a qualified access without the
>>hassle of separate "queryInterface" calls.
>>
>>
> Hmm, well, no, not really. OOo Basic gets the name of a method and then
> it starts to look for it, if not found, it'll look in the interfaces,
> first match wins, if I understand the behaviour correctly.
What I meant is that OOo Basic has an *extended* syntax that allows to
specify the interface name in a way that is comparable to what ooRexx
seems to do. The following code snippet shows this:
> oListener =
> CreateUnoListener("DocumentListener_","com.sun.star.document.XEventListener")
> ThisComponent.com_sun_star_document_XEventBroadcaster_addEventListener(
> oListener )
I don't think that Basic developers would want to use this syntax in
*every* call. This makes the code fragile (at least basically) as
Stephan correctly pointed out.
Best regards,
Mathias
--
Mathias Bauer - OpenOffice.org Application Framework Project Lead
Please reply to the list only, [EMAIL PROTECTED] is a spam sink.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]