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: 103376,3d3f20d31be1c33a X-Google-Attributes: gid103376,public X-Google-Thread: fac41,2c6139ce13be9980 X-Google-Attributes: gidfac41,public From: Paul Johnson Subject: Re: Precondition Checking For Ada 0X (Was: Separation of IF and Imp: process issue?) Date: 1997/09/17 Message-ID: #1/1 X-Deja-AN: 273367629 References: <341eac5e.0@news.uni-ulm.de> Distribution: world X-NNTP-Posting-Host: treetop.demon.co.uk [158.152.55.135] Organization: home Newsgroups: comp.lang.ada,comp.lang.eiffel Date: 1997-09-17T00:00:00+00:00 List-Id: In article <341eac5e.0@news.uni-ulm.de>, Joerg Rodemann writes >A short question on the side to our Eiffel friends: are the Eiffel invariants >visible to the client or are the just there to ensure object state consistency >so that it is able to recognize an error condition? I. e. I assume they may >rely on private member variables, don't they? Yes. The only kind of Eiffel assertion that may not use private variables is the precondition, because the client must be able to tell if its about to break the contract. No hidden clauses allowed. Postconditions and invariants generally use public variables because they form part of the interface specification. But if the class author wants to specify internal consistency constraints as part of a routine then thats just fine. It can even be necessary: if a descendant redefines the routine it is still constrained by the postconditions and invariants. Paul. --------------------------------+--------------------------------- Paul Johnson | You are lost in a maze of twisty Email: Paul@treetop.demon.co.uk | little standards, all different. paul.johnson@gecm.com |