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,f66d11aeda114c52 X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,f66d11aeda114c52 X-Google-Attributes: gid103376,public From: Nick Leaton Subject: Re: Design By Contract Date: 1997/09/09 Message-ID: <34150AE7.ABE4EDD6@calfp.co.uk>#1/1 X-Deja-AN: 270925951 References: <341041A6.E45B6425@calfp.co.uk> Reply-To: nickle@pauillac X-NNTP-Posting-Host: calfp.demon.co.uk [158.152.70.168] Newsgroups: comp.lang.ada,comp.lang.eiffel Date: 1997-09-09T00:00:00+00:00 List-Id: Jon S Anthony wrote: > > Selective revealing of interface I presume is OK, so > > what mechanism would you provide in its place? > > For something like Eiffel (where everything is defined via inheritance > based classification), I think the solution provided is reasonable. > I found things like Eiffel's use of inheritance for getting access to the facilities a little odd at first, but in practice it doesn't turn out to be a problem. Having good names for these classes help. One use is to get access to a set of constant objects in which case mostly we use _CONVENTION at the end of the class name. For functions such as sin and cos, then anthropromorphise (or the code equivalent ;-) ) the class, such as MATHEMATICIAN or STATISTICIAN. Some of are classes here end in _CALCULATOR fall into this category. It then makes it easy to identify or guess what the class is being used for. I would also put them at the end of the inheritance list if you are using MI. -- Nick Eiffel - Possibly the best language in the world - unless proven otherwise.