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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!mx05.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Ada202X: Easy to use "UML private"-like components Date: Sat, 22 Jun 2013 14:10:18 +0200 Organization: cbb software GmbH Message-ID: References: <69246de0-4b33-4d47-b5be-a45e8c911fb0@googlegroups.com> <28f43920-c490-4da0-80b3-6405dec09879@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: xkOZ88C3T5fLavXpgyt3vA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:15892 Date: 2013-06-22T14:10:18+02:00 List-Id: On Sat, 22 Jun 2013 04:16:55 -0700 (PDT), Martin wrote: > On Friday, June 21, 2013 3:51:32 PM UTC+1, Dmitry A. Kazakov wrote: >> On Fri, 21 Jun 2013 02:33:11 -0700 (PDT), Martin wrote: >> >>> But no easy means of keeping member data private from children. >> >> On the contrary, don't make them children. > > But then I loose visibility of the classes protected operations... No operation can be both protected and private, not even in UML... The point is that Ada offers the same choice as UML does. However the roles are different. UML follows C++ where it is the provider of the type who must choose between public/protected/private. In Ada its public vs. not public for this role. Protected vs. public is to be decided by the user, i.e. much later. It is a good approach IMO, because protected vs. private choice is frequently far to premature for the provider. A too heavy burden to do, as usage of C++ shows. In the end the most sound policy for C++ is to avoid private operations except for the cases when Ada programmer would a subprogram into the package body. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de