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: "Eirik Mangseth" Subject: Re: Design by Contract (was Re: Interesting thread in comp.lang.eiffel) Date: 2000/07/13 Message-ID: #1/1 X-Deja-AN: 646038994 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> <7r66qbf1xw.fsf@butter.albany.duck.com> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 X-Complaints-To: news-abuse@online.no X-Trace: news1.online.no 963518423 130.67.72.56 (Thu, 13 Jul 2000 22:00:23 MET DST) Organization: Telenor Online Public Access X-MSMail-Priority: Normal NNTP-Posting-Date: Thu, 13 Jul 2000 22:00:23 MET DST Newsgroups: comp.lang.eiffel,comp.lang.ada Date: 2000-07-13T00:00:00+00:00 List-Id: "Matthew J Heaney" wrote in message news:7r66qbf1xw.fsf@butter.albany.duck.com... > 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. Oh god, not again. This is not true at all. In OOSC2 the author asks the question: "Would you rather buy or inherit" and goes to great length in discussing the pro and cons of both approaches. As every experienced Eiffel (and OO programmer knows) inheritance and aggregation are complementary and their usage depends on the goals you try to achieve. Instead of stating such claims, why don't you sit down and learn the language? > > 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. In Eiffel as well. > So contract checks don't need to be any > more sophisticated than simple assertion checks. > > And all programming can be done in assembly best regards Eirik Mangseth Stockpoint Nordic AS Lysaker, Norway "If I can't Eiffel in heaven, I won't go"