Re: Clean Object Class Design -- Circle/Ellipse
Date: Sun, 19 Aug 2001 14:44:57 GMT
Message-ID: <3b7fbfc7.3735066201_at_news.grpvine1.tx.home.com>
On Sun, 19 Aug 2001 04:54:53 GMT, "Richard MacDonald"
<macdonaldrj_at_att.net> wrote:
>Marc, what is the point of this?
Simpler yet, comparison of Stroustrup vs Date.
I am unable to bring up Date's article on dbdebunk.com,
and I don't want to "quote" from memory, so let's try this:
Take C++ (no role model, but that's what the article refers to)
Remove Stroustrup inheritance.
What are the benefits of C+- over C++ ?
1. Comparison of utility of Liskov definition of subtype
(substitutable behavior) vs Date definition.
Add Date "inheritance" (however he defines it)
Call the new languge C+- ;-).
> An axiom limited to functions where the
>argument and result are the same type
>isn't any good for building a type theory.
Actually, it is. It guarantees LSP.
To begin with, I only ask that set set of axioms of the supertype be a subset of the set of axioms of the subtype (wrt the standard, FOL disjunctive normal form representation of these axioms), and only for abstract types. That result is the same type as arguments is just a consequence of that requirement (for operations that produce values of the supertype) in combination with the closure axiom.
Note: I also ask that the two axiomatizations are consistent, meaning not every constraint is an axiom.
Once you are down to concrete classes, they are not subtypes but rather implementations of the abstract type. They are not (directly) substitutable for one another -- the abstract supertype defines the conversion axioms.
Another (side) point:
Given choice (knowledge, time, and materials), one should
use composition rather than inheritance (for example
construct rationals from itegers, not the other way around).
Marc Gluch
Mindtap Inc.
Received on Sun Aug 19 2001 - 16:44:57 CEST