[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Curl, multiple inheritance, and interfaces (was Re: cheerful static typing)
----- Original Message -----
From: "Matthias Felleisen" <email@example.com>
Cc: <firstname.lastname@example.org>; <email@example.com>; <firstname.lastname@example.org>
Sent: Saturday, January 12, 2002 12:01 PM
Subject: Re: Curl, multiple inheritance, and interfaces (was Re: cheerful
> I agree in principle. In practice, though, this kind of thing seems to
> complicated quickly - Eiffel might be an example. My purely subjective
> is that there seems to be a point beyond which diminishing returns ...
> What's worse, Eiffel's system of checking contracts is pretty much flawed.
> It fails to take into account the hierarchy. What's worse is that the
> people who built Java tools for specifying contracts and monitoring them
> copied Eiffel's approach and have the same flaws.
Eiffel requires that preconditions and postconditions are weakened and
strengthened appropriately in descendant classes. Isn't this taking the
hierarchy into account? I think the problem with Eiffel is not with how the
contracts are specified in the language, but that there is no tool to verify
that the contracts are satisified (at least not efficiently).
I can't see better interfaces in mainstream languages unless they:
1. Express properties that can be efficiently verified (preferably
2. Don't add much conceptual weight.
Based on these critiera I'm picking the following improvements to interfaces
in the short term:
* Annotation of objects/methods with security constraints. For example
annotate a method with a list of roles/users that are allowed to invoke the
* Annotation of methods to express properties such as commutativity (as
suggested by Dan Weinreb). This further blurs the distinction between
user-defined and built-in objects which is a good trend in language design.