Rony G. Flatscher 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.

OTOH I assume that using this in *every* code line makes the code ugly
so that ppl might not want to do so (at least in Basic). Then Stephan
has his point that the resulting code is fragile: even if it works ATM
it can break later when a new interface is added to an object that
introduces a name clash.

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]

Reply via email to