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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.67.8.98 with SMTP id dj2mr17696554pad.11.1448837582184; Sun, 29 Nov 2015 14:53:02 -0800 (PST) X-Received: by 10.182.148.165 with SMTP id tt5mr602769obb.20.1448837582005; Sun, 29 Nov 2015 14:53:02 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!mv3no5838765igc.0!news-out.google.com!l1ni21igd.0!nntp.google.com!mv3no7445685igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 29 Nov 2015 14:53:01 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=109.88.54.35; posting-account=6m7axgkAAADBKh082FfZLdYsJ24CXYi5 NNTP-Posting-Host: 109.88.54.35 References: <3d45e3ed-16ca-4018-bf7b-62830acaca03@googlegroups.com> <44e20a95-703c-4316-8dda-aa2c8d07dfb1@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <29d3244c-1769-4cb7-8af3-e1b20eb2e1e2@googlegroups.com> Subject: Re: accessibility check failed From: Serge Robyns Injection-Date: Sun, 29 Nov 2015 22:53:02 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:28600 Date: 2015-11-29T14:53:01-08:00 List-Id: On Sunday, 29 November 2015 23:32:30 UTC+1, Jeffrey R. Carter wrote: > On 11/29/2015 12:00 PM, Serge Robyns wrote: > > On Sunday, 29 November 2015 19:37:07 UTC+1, Jeffrey R. Carter wrote: > It's quite genuine. The most common problems posted on here of the "Why a= m I > getting this msg?" or "Why doesn't this do what it should?" sort relate t= o > anonymous access types and programming by extension. I conclude that they= were > mistakes and should not have been added to the language. My aversion to > programming by extension goes back to the early 1990s when it was propose= d for > Ada 9X. I experimented with the proposals and found that it makes code ha= rder to > read than equivalent code without it. >=20 > Access types are notoriously error-prone, so any necessary use of them sh= ould be > hidden as deeply as possible (and given the unbounded containers, there a= re very > few necessary uses). Using public access types and foisting what should b= e > hidden onto the clients of the pkgs in which they appear may make them ea= sier to > write, but harder to use, and increases errors in the overall program. Av= oiding > public access types is a design rule I follow scrupulously. >=20 > --=20 In my case I'm trying to build an interface to hide implementation details.= The code provided is using containers as a store but should also be able = to use any kind of (R)DBMS for all or part of the data. And hence this is = where the beauty of OO comes but does indeed require to use access type to = "keep" track of things. I admit I'm trying to implement some patterns that typically relies on "ref= erences". What would be the alternative to a Bridge pattern. Ada brings a lot of value with tagged types which other OO languages to fai= l to have, at least AFAIK. For example, Ada will check the tag type when a= llocating/converting from 'Class return to whatever. In my case X :=3D T_A= BC_DAO (func (xyz)); it will check that func(p) return T_ABC'Class has inde= ed returned something that is a T_ABC_DOA. I do admit that OO brings more "indirection" than strait code but then ofte= n people implement something similar by building their own dispatches or al= ike. Serge