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=unavailable autolearn_force=no version=3.4.4 Path: backlog2.nntp.ams3.giganews.com!backlog2.nntp.ams2.giganews.com!backlog2.nntp.ams.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!weretis.net!feeder4.news.weretis.net!newsfeed.datemas.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Ada202X: Easy to use "UML private"-like components Date: Wed, 10 Jul 2013 20:41:30 +0100 Organization: A noiseless patient Spider Message-ID: References: <69246de0-4b33-4d47-b5be-a45e8c911fb0@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: mx05.eternal-september.org; posting-host="c8504a89c76ea11bda6664e6198ae3cd"; logging-data="15697"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+dDQC3irnqXv4yqBAMBXwgWF+bOL1J6cs=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin) Cancel-Lock: sha1:fXP+pQj19vK/1YyTgQ7X8/2de8g= sha1:oG6ghebtdEY6DglapUJKdBY8aoo= Xref: number.nntp.dca.giganews.com comp.lang.ada:182442 Date: 2013-07-10T20:41:30+01:00 List-Id: Martin writes: > That's fine for one half the equation (implementing the "private" > using one if the techniques mentioned before) but it still leaves > using the "private" components...that's still a mess (my description!) > isn't it? I was thinking that for full code gen the translator could say "this operation in the child class is trying to access a private attribute of the parent! No!" and report a translation error. Clearly not possible for framework-only generators. My ColdFrame[1] (a) declares the instance record in the private part of the class package, regardless of what you put in the model, (b) supports provision of «accessor» operations, and (c) implements inheritance using its own mechanisms rather than via tagged types; so "public" attributes are those given accessors by the modeller, all others are "private". I could automatically generate accessors for attributes marked "public", but I think that people should be made to work a bit to get access to instance variables of other classes! [1] https://sourceforge.net/projects/coldframe/