[Types-sig] QueryProtocol

Michel Pelletier michel@digicool.com
Tue, 20 Mar 2001 19:04:58 -0800 (PST)


On Tue, 20 Mar 2001, Paul Prescod wrote:

> >     An interface protocol identifier is a lower-case string having
> >     a reverse DNS host name string:
>
> 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.

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

> >     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".

-Michel