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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,e01bd86884246855 X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,fb1663c3ca80b502 X-Google-Attributes: gid103376,public From: Matthew J Heaney Subject: Re: Design by Contract (was Re: Interesting thread in comp.lang.eiffel) Date: 2000/07/12 Message-ID: <7r66qbf1xw.fsf@butter.albany.duck.com>#1/1 X-Deja-AN: 645678889 Sender: mheaney@butter.albany.duck.com References: <8ipvnj$inc$1@wanadoo.fr> <8j67p8$afd$1@nnrp1.deja.com> <395886DA.CCE008D2@deepthought.com.au> <3958B07B.18A5BB8C@acm.com> <395A0ECA.940560D1@acm.com> <8jd4bb$na7$1@toralf.uib.no> <8jfabb$1d8$1@nnrp1.deja.com> <8jhq0m$30u5$1@toralf.uib.no> <8jt4j7$19hpk$1@ID-9852.news.cis.dfn.de> <3963CDDE.3E8FB644@earthlink.net> <3963DEBF.79C40BF1@eiffel.com> <396502D2.BD8A42E7@earthlink.net> <39654639.B3760EF2@eiffel.com> <85Fa5.11419$7%3.818927@news.flash.net> <01HW.B591811303737A0605DE478C@news.pacbell.net> <04377e22.ac0aac49@usw-ex0107-055.remarq.com> X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 963443008 208.136.9.227 (Wed, 12 Jul 2000 16:03:28 PDT) Organization: EarthLink Inc. -- http://www.EarthLink.net NNTP-Posting-Date: Wed, 12 Jul 2000 16:03:28 PDT Newsgroups: comp.lang.eiffel,comp.lang.ada Date: 2000-07-12T00:00:00+00:00 List-Id: Greg writes: > In Eiffel, DbC works with inheritance. So a subclass is bound to the > same contract as its parent class automatically. Not being an Ada > guru, I'd guess you would have to copy the parent's contract into the > child, leading to undesirable duplication. Yes, it's true that Eiffel's contract-checking is more sophisticated than a simple assertion-check. However, Eiffel *has* to be this way, because the idiom in that language is inheritance-based programming. Abstractions are composed using inheritance. But in Ada, it's very rare that you have deep inheritance lattices, because there are language features that allow you to compose abstractions using aggregation. So contract checks don't need to be any more sophisticated than simple assertion checks.