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 2002:a05:660c:b48:: with SMTP id m8mr11124428itl.37.1550411178176; Sun, 17 Feb 2019 05:46:18 -0800 (PST) X-Received: by 2002:a54:4d86:: with SMTP id y6mr92403oix.0.1550411177913; Sun, 17 Feb 2019 05:46:17 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.uzoreto.com!2.eu.feeder.erje.net!4.us.feeder.erje.net!feeder.erje.net!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!y22no323661ita.0!news-out.google.com!v188ni688itb.0!nntp.google.com!y42no289898ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 17 Feb 2019 05:46:17 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=70.109.61.2; posting-account=QF6XPQoAAABce2NyPxxDAaKdAkN6RgAf NNTP-Posting-Host: 70.109.61.2 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <51243c9b-baba-43ad-b227-fe39c045d403@googlegroups.com> Subject: Re: Private extension of a synchronized interface From: Jere Injection-Date: Sun, 17 Feb 2019 13:46:18 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:55542 Date: 2019-02-17T05:46:17-08:00 List-Id: On Sunday, February 17, 2019 at 4:50:24 AM UTC-5, Dmitry A. Kazakov wrote: > > But synchronized interfaces are totally bogus from the software design > POV. It is a pure implementation aspect exposed. Why do you care? > Aggregate a protected object and delegate primitive operations to it. > That's what I am doing as my own solution. I was intrigued with the code above as an alternate solution because it could potentially give a compile time indication that a procedure was a protected operation (as opposed to me relying on simply providing that via comments). A delegate non protected procedure has to rely on the comment. I didn't even want the interface to use as an interface, just as a means to at the API level to have a compiler enforced indication that the procedure was from a protected object. I started with a protected object in the public view but the implementation details of the private part of the protected object led to about 10 lines of code (type declarations and a couple of package specifications) that had no use to the public view but had to be there because of how protected object declarations work. I saw this as a potential means of information hiding. My actual solution is as you suggested with delegate operations that call the protected object. However, I honestly wanted to know why Ada allowed one to setup the private extension but not allow you to actually provide the functions (or if this was a GNAT issue or if I was just not using the right syntax). So the reason I care was a thirst for knowledge of how things work.