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: f43e6,9a0ff0bffdf63657 X-Google-Attributes: gidf43e6,public X-Google-Thread: 103376,4b06f8f15f01a568 X-Google-Attributes: gid103376,public X-Google-Thread: 1108a1,9a0ff0bffdf63657 X-Google-Attributes: gid1108a1,public From: Biju Thomas Subject: Re: Which wastes more time? (Was Re: Software landmines (loops)) Date: 1998/09/06 Message-ID: <35F345F8.9FF67834@ibm.net>#1/1 X-Deja-AN: 388556796 Content-Transfer-Encoding: 7bit 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> <6svaju$btl@gurney.reilly.home> X-Notice: should be reported to postmaster@ibm.net Content-Type: text/plain; charset=x-user-defined X-Complaints-To: postmaster@ibm.net X-Trace: 7 Sep 1998 02:31:08 GMT, 32.100.143.70 Organization: IBM.NET MIME-Version: 1.0 Reply-To: bijuthom@ibm.net Newsgroups: comp.lang.eiffel,comp.object,comp.software-eng,comp.lang.ada Date: 1998-09-06T00:00:00+00:00 List-Id: Andrew Reilly wrote: > > In article <35F1C0B9.8A50CEB0@s054.aone.net.au>, > Loryn Jenkins writes: > > > 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. How can you come to this last conclusion? A mammal is either a cow or not a cow for its entire existence. It cannot be cow for some time and human for the rest of its existence. Remember that we are talking about a particular instance of mammal, not all mammals. The supertyping described as an is-a relationship applies to a single instance, not all instances. A *particular* Person can be a car owner one day and cease to be a car owner next day. On the other hand, a *particular* mammal, which is a cow, is a cow for its entire existence. Biju Thomas