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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,23cf9f1e93744eed X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-08-01 06:16:19 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!wn14feed!wn13feed!wn11feed!worldnet.att.net!207.35.177.252!nf3.bellglobal.com!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail From: "Warren W. Gay VE3WWG" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Need advice re package organization. References: <3F228F3B.9020203@attbi.com> <3F22F9E9.3040307@attbi.com> <5jn9ivoetll1fu2avn9hmjj6aaa7q7pmjn@4ax.com> <9d2Wa.301$jp.253@newsread4.news.pas.earthlink.net> <3F299920.9070603@attbi.com> In-Reply-To: <3F299920.9070603@attbi.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Fri, 01 Aug 2003 09:01:15 -0400 NNTP-Posting-Host: 198.96.223.163 X-Complaints-To: abuse@sympatico.ca X-Trace: news20.bellglobal.com 1059742869 198.96.223.163 (Fri, 01 Aug 2003 09:01:09 EDT) NNTP-Posting-Date: Fri, 01 Aug 2003 09:01:09 EDT Organization: Bell Sympatico Xref: archiver1.google.com comp.lang.ada:41124 Date: 2003-08-01T09:01:15-04:00 List-Id: Robert I. Eachus wrote: > Warren W. Gay VE3WWG wrote: > >> Is this a show stopper? Well, no. But it has been long >> recognized in the software industry that information hiding >> promotes safety. All I am saying, is that Ada95 seems to >> lack this feature and it should perhaps be more vigorously >> discussed ;-) > > If I understand you correctly, what you would like is a syntax for > saying that the components of an object can not be modified outside the > package hierarchy, but can be read. I am basically looking for private and protected type class qualifiers a al (dare I say it), C++. The problem is that the entire tagged record (object) is completely visible to child package code, at times when I wish it wasn't (for safety's sake). Its a small point, but I only raised it for general discussion as a minor weakness. > I can imagine a syntax for doing this, but it wouldn't add any safety. > (If nothing else a user could use Unchecked_Conversion to declare a > matching type.) There is no protection for those that are determined to work around it. There are many ways to defeat protections, and another way is to break into C code and do what you will. But I am not worried about that. In the child package case, I am the one doing the programming (if I am the author of the parent package). However, what sometimes happens is that the child package derives from a parent package object, but still enjoys full visibility of the base type's innards. For some objects, this is highly undesireable, and leads to unwanted coupling (leading to unwanted mistakes of reference). -- Warren W. Gay VE3WWG http://home.cogeco.ca/~ve3wwg