[Types-sig] QueryProtocol

Clark C. Evans cce@clarkevans.com
Tue, 20 Mar 2001 22:50:41 -0500 (EST)


On Tue, 20 Mar 2001, Michel Pelletier wrote:
> > Why a string? What if we let an interface be any object and we used
> > object identity to compare them? That way we don't have to introduce a
> > new namespace into Python. I have never seen a reverse-DNS string in a
> > Python program and I am leery of adding the concept.
> 
> I agree with this: interfaces should live in the name dot qualified
> namespaces that classes live in, ie, there is some absolute dotted name
> for the interface object ala Package.Module.Class, interfaces should be
> Package.Module.Interface.

I'm just trying to keep the coupling very loose so that
it can be fixed up later. 

> Giving them string names or GUID or any other identifier would be way to
> complex.  IMO, that's what's wrong with COM.

Ok, this is three thus far that things that a 
string here doesn't work.  In an upcoming
revision this will be fixed.
 
> > >     In addition, a built-in query method could be introduced that
> > >     calls the __query__ method on a given object.
> >
> > You mean "query function."
> 
> The way I understand the proposal, you query some interface for an object
> that implements an well known interface.
> 
>   o Where does the initial query interface come from? 
>   o Does a registry need to be kept (probably)? 
>   o What if multiple object implement the same interface?
> 
> These are all fairly similar problems with COM, where Microsoft answers
> answer the three questions: "from us", "yes" and "they don't".
> 
> I think Python should answer: "you don't need it", "no", and "no problem".

Agreed.  Although the proposal is on the surface similar
to Microsoft's QueryInterface, it is very different in this
respect, and many other respects.

Thank you so much for taking the time to review.  I'll be 
incorporating your comments shortly.

Best,

Clark