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,b87849933931bc93 X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,b87849933931bc93 X-Google-Attributes: gid103376,public X-Google-Thread: f43e6,b87849933931bc93 X-Google-Attributes: gidf43e6,public X-Google-Thread: 114809,b87849933931bc93 X-Google-Attributes: gid114809,public X-Google-Thread: 1108a1,b87849933931bc93 X-Google-Attributes: gid1108a1,public X-Google-Thread: 109fba,b87849933931bc93 X-Google-Attributes: gid109fba,public From: simon.willcocks@octel.com (Simon Willcocks) Subject: Re: What is wrong with OO ? Date: 1997/02/18 Message-ID: <5ecefd$13j@news.eng.octel.com>#1/1 X-Deja-AN: 219624448 References: <5dopri$dei@news4.digex.net> <3301D875.188B@mmm.com> Organization: Octel C/SSD Newsgroups: comp.lang.c++,comp.lang.smalltalk,comp.lang.eiffel,comp.lang.ada,comp.object,comp.software-eng Date: 1997-02-18T00:00:00+00:00 List-Id: In article <3301D875.188B@mmm.com>, kjhopps@mmm.com (Kevin J. Hopps) says: >Jon S Anthony wrote: >> [...] >> Nick is correct here. This is a problem in C++ (along with >> friendship) as it requires prescience on the part of the developer >> and/or various maintenance problems: if you later decide it should be >> virtual, you have to go back and _change_ the source of the parent >> thereby changing the semantics in various other places. If you decide >> you need a new "friend" you have to go back and _change_ the source >> (which you may not even have accesss to!) > >This problem is one which arises naturally in any OO design. For any >class operation, the author of that class must make decisions about its >semantics, and trust that subclasses adhere to those semantics. In Eiffel the semantics of a method are defined by its pre- and post- conditions, and the class invariant. All subclasses _have_ to comply with those semantics, otherwise runtime checks will fail. There is no "trust" required, at least not until the checks are turned off. Additionally, the authors of a subclass have a much easier time because it is made clear what the original class' author had in mind when defining the interface to the class. Simon