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.6 required=5.0 tests=BAYES_40,INVALID_MSGID 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: "Paolo F. Cantoni" Subject: Re: Which wastes more time? (Was Re: Software landmines (loops)) Date: 1998/09/09 Message-ID: <6t6o07$k8u$2@the-fly.zip.com.au>#1/1 X-Deja-AN: 389512111 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> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0 Organization: -Semantica- Newsgroups: comp.lang.eiffel,comp.object,comp.software-eng,comp.lang.ada Date: 1998-09-09T00:00:00+00:00 List-Id: Hi Loryn, I've come in late on this discussion - so please excuse some unfamiliarity. [SNIP...] >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. > >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?) This is a continuing problem in modelling business situations - we've got around this by postulating the notion of static sub-typing, as you have defined it above... and what we've (probably eroneously) called dynamic sub-typing. Dynamic sub-typing requires that you obey the rules at the time the question is asked: That is, if I ask the object are you a car-owner and it replies yes, then all the methods and attributes of car owner are available. If the answer is no, then they aren't. This is as you suggest below - essentially what happens in the "State pattern". What we've found is that by treating them as "statically" as possible during the modelling process - so they look jus tlike static sub-types, we can get the applicable business rules and create better objects. Obvously language support for such concepts is problematic - but we've found it useful in working wih the client to accurately defining the problem space and the applicable business rules. >The Role Pattern (very similar to Gamma et al's State Pattern) just >described here doesn't necessarily model 'the real world'. I think it >does model our 'concept of the world', according to a certain >classification theory. Do you have a formal definiton of the "Role Pattern"? >Loryn Jenkins Regardz, Paolo F. Cantoni Tel: +61-2-9498 5945 Director Fax: +61-2-9418 4402 -Semantica- Cell: +61-416 11 00 95 Suite 2, Charing House EMail: pcantoni@semantica.com.au 45 Kendall Street Web: http://www.semantica.com.au Pymble NSW 2073 AUSTRALIA "Many problems turn out to be caused by invalid concepts. Conceptual Modelling provides techniques for solving them..." -Semantica- can help your organisation understand itself better and thus operate more effectively and efficiently...