[Types-sig] QueryProtocol

Michel Pelletier michel@digicool.com
Thu, 22 Mar 2001 22:36:54 -0800 (PST)


On Fri, 23 Mar 2001, Clark C. Evans wrote:

> > It's more about not specifying interfaces at the point of a class
> > definition than about the method of their specification and checking.
>
> Exactly, and this is what I was trying to convey:
>
>    declare     -> The class C declares: "I implement interface I".

That's cool.

>    descriptive -> The interface describes what it needs
>                   for a class to be compliant.  Then, later
>                   a checking mechanism (perhaps using the
>                   Interface itself) looks at the description,
>                   looks at the class and exclaims:
>                   "Upon examination of the methods, attributes,
>                    signature and other information available
>                    regarding the class C, it does indeed
>                    comply with the interface description."

Why does it actually have to *check* that much?  C is asserting I, so why
don't you just trust it?  If you check all that every time, interfaces are
going to be very expensive.

If you really want to *test* it, use a unit test.

-Michel