From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,9a0ff0bffdf63657 X-Google-Attributes: gidfac41,public X-Google-Thread: 1108a1,9a0ff0bffdf63657 X-Google-Attributes: gid1108a1,public X-Google-Thread: f43e6,9a0ff0bffdf63657 X-Google-Attributes: gidf43e6,public X-Google-Thread: 103376,4b06f8f15f01a568 X-Google-Attributes: gid103376,public From: reilly@zeta.org.au (Andrew Reilly) Subject: Re: Which wastes more time? (Was Re: Software landmines (loops)) Date: 1998/09/07 Message-ID: <6svaju$btl@gurney.reilly.home>#1/1 X-Deja-AN: 388553163 References: <6rfra4$rul$1@nnrp1.dejanews.com> <35DBDD24.D003404D@calfp.co.uk> <6sbuod$fra$1@hirame.wwa.com> <6sebjr$b69$1@nnrp1.dejanews.com> <6sff74$q0s@gurney.reilly.home> <6sh2j5$jnl$1@nnrp1.dejanews.com> <35EC2E5A.16DB6CB1@bigfoot-.com> <6sjc0a$1lk$3@news.indigo.ie> <35EFB09E.15412933@s054.aone.net.au> <35f2bd98.40599408@news.erols.com> <35F06A58.F968BDE1@s054.aone.net.au> <35f48276.90997557@news.erols.com> <35F0C3C9.D1E56FF3@s054.aone.net.au> <6srh67$sj5$1@hirame.wwa.com> <35F1C0B9.8A50CEB0@s054.aone.net.au> Content-Type: text/plain; charset=us-ascii Organization: Andrew and Catherine Reilly at home Mime-Version: 1.0 Reply-To: reilly@zeta.org.au Newsgroups: comp.lang.eiffel,comp.object,comp.software-eng,comp.lang.ada Date: 1998-09-07T00:00:00+00:00 List-Id: In article <35F1C0B9.8A50CEB0@s054.aone.net.au>, Loryn Jenkins writes: >[someone else:] >> Meyer presents a model in which >> CAR_OWNER inherits from PERSON and uses CAR. And this is certainly a much >> better model. > > Agreed. But it still flouts basic classification theory. You'll have to make your explanation of this failure more explicit for me, I'm afriad. On the basis of your exposition, below, I don't see it. > I find this test to be a very useful in finding whether a (sub-type) > inheritance relationship should hold: > > Is the child class a type of the parent class, and will it be for the > whole of its existence? And, is the parent class a supertype of the > child class, and will it be for the whole of its existence? > > That is, in this example: > (1) Is a CAR_OWNER a PERSON, and will it be for the whole of its > existence? > (A1) Yes. > > (2) Is a PERSON a CAR_OWNER, and will it be for the whole of its > existence? > (A2) No. Any PERSON can buy and sell cars, moving its status from car > owner to not multiple times during their life. Supertyping is clearly /not/ an "is-a" relationship, though. Cows are a (sub)type of mammal, and a cow "is-a" mammal (for the whole of its existence), but a mammal is not necessarily a cow. So the failure of PERSON to hold an "is-a" relationship with CAR_OWNER doesn't seem to me to defeat the classification. Sure, you can introduce roles, as a refinement of the model, if that's convenient for your application, but I can't see how you can say that for this particular example the absense of that refinement is actually *wrong*. > As far as I'm concerned, this flouts basic classification theory. As far > as I'm concerned, this is *wrong*. (How can you claim to be programming > for reuse, as Meyer so eloquently points out as a fundamental goal, and > model things so rigidly? So incorrectly?) Please explain this "incorrectness" more clearly. -- Andrew Reilly Reilly@zeta.org.au