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,f66d11aeda114c52 X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,f66d11aeda114c52 X-Google-Attributes: gid103376,public From: jsa@alexandria.organon.com (Jon S Anthony) Subject: Re: Design By Contract Date: 1997/08/29 Message-ID: #1/1 X-Deja-AN: 268969066 Distribution: world References: Organization: PSINet Newsgroups: comp.lang.ada,comp.lang.eiffel Date: 1997-08-29T00:00:00+00:00 List-Id: In article nospam@thanks.com.au (Don Harrison) writes: > :Isn't that exactly the point? Why should a client be able to see the > :actual structure, aka implementation???? > > No, the point is that there is no need to hide the structure of an attribute > so long as it's read-only (look-but-don't-touch). These semantics allow you > to query components of visible objects directly: I'm not convinced that is sufficient. Knowing the structure can lead one into writing things that still depend on it (efficiency hacks come quickly to mind). > I prefer the Eiffel model because: > > - It's simple and direct. > - It doesn't clutter the spec and body with functions. > - It doesn't force you to invent multiple identifiers (one of which has > a contrived name: "the_a" above). Fine. Of course, all of these are simply _subjective_ characterizations. If that is what floats your boat - go for it. > IMO, the other possibilities for attributes in Ada are unattractive > because they are either too permissive (look-and-touch - attributes > declared in the visible part of the spec) or too restrictive > (don't-look-don't touch - private attributes). Again, this is simply personal perspective. It may mean a lot to you, but you should be aware that this subjective stuff ("unattractive" "too permissive" "too restrictive") is just opinion and preference and that others may well view _your_ preferences as "unattractive", "too permissive" and "too restrictive". There just is no consistent objective criteria here. And no amount of saying it's so will make it so. /Jon -- Jon Anthony OMI, Belmont, MA 02178, 617.484.3383 "Nightmares - Ha! The way my life's been going lately, Who'd notice?" -- Londo Mollari