On Thursday, July 24, 2003, at 11:17 AM, Austin Hastings wrote:

No, I think Java interfaces are a kluge to get around copying a
broken type system and the lack of multiple inheritance.

Multiple Inheritance != Protocols | Interfaces

I quite agree, but I've done enough Java to know that if they could have "solved" it with MI, they would have.


Protocols/Interfaces is a way of saying "My structure is none of your
damn business, but I comply with the rules you've set."

Yes, exactly.


I disagree, and I hope you've simply swapped terms around.

I think you want to declare "I comply with ruleset X" at the callee
object level. That enables the compiler to (1) check that you're not
lying; and (2) optimize based on (1).

At least one of us is using "caller/callee" in the X11 sense. What I mean and what I think you mean is:


method foo ( Thingie $t ) { ... }

$object->foo( $behaves_like_thingie );

foo() says, "Give me something that I can treat like a Thingie. I don't care HOW it does it, I just want it to do something sane."

$behaves_like_thingie is an instance of a class that somehow says, "Hey, I act like Thingie. I'm substitutable for Thingie if you don't break my encapsulation."

If we're just confused over a bit of terminology, we're in violent agreement on the idea, which is much more important.

-- c



Reply via email to