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.6 required=5.0 tests=BAYES_00,TO_NO_BRKTS_FROM_MSSP autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8435c6357dfc5329 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-08-20 07:26:43 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!feed.textport.net!newsranger.com!www.newsranger.com!not-for-mail Newsgroups: comp.lang.ada From: Ted Dennison References: <3B7DAEA0.60043A96@gsde.hou.us.ray.com> <3B7DB563.82D3F842@acm.org> Subject: Re: User-defined access dereference Message-ID: X-Abuse-Info: When contacting newsranger.com regarding abuse please X-Abuse-Info: forward the entire news article including headers or X-Abuse-Info: else we will not be able to process your request X-Complaints-To: abuse@newsranger.com NNTP-Posting-Date: Mon, 20 Aug 2001 10:26:24 EDT Organization: http://www.newsranger.com Date: Mon, 20 Aug 2001 14:26:24 GMT Xref: archiver1.google.com comp.lang.ada:12126 Date: 2001-08-20T14:26:24+00:00 List-Id: In article <3B7DB563.82D3F842@acm.org>, Jeffrey Carter says... > >"Stanley R. Allen" wrote: >> >> Now we are faced with another situation in which it would be nice to replace >> ".all". This time, there are over 10,000 dereferences in over a million >> lines of code, so it's out of the question to do to this code what was done > >I think you should make your access type private. Then any dereferences, >explicit or implicit, will be illegal, and the compiler will catch any >you miss. I'll heartily second that. Its generally a bad idea to give folks direct visibility inside of a record structure declared in a package spec, and this is *exactly* why. You should be able to change the internal structure of that "object" at will. But since you provided its clients a "help-yourself" structure rather than a private object, you now are seriously impeeded from making any serious structural change. (the first "you" here is plural btw. I realise it probably wasn't Stanley who wrote this bad code) My advice at this point would be to make the thing private, give it the proper interface routines, then go fix (or better yet, make the package's original author do this) every occurance in client code that the compiler flags. Consider it the software equivalent of having to write "I will not export public data structures" on the blackboard 10,000 times. :-) As Ben Franklin said, "Experience is a dear teacher..." --- T.E.D. homepage - http://www.telepath.com/dennison/Ted/TED.html home email - mailto:dennison@telepath.com