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 X-Google-Thread: 103376,c08a7609345f4e5 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder.news-service.com!weretis.net!feeder4.news.weretis.net!news.mixmin.net!news2.arglkargh.de!noris.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Limited use for limited with? Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <853314bc-0f79-435f-86a5-d7bcdd610731@c10g2000yqh.googlegroups.com> <36e886fa-b272-461f-bf86-a6b18366b64f@i5g2000yqe.googlegroups.com> <1eug9v5h5mf8d$.ud00hrz48lyr.dlg@40tude.net> <67044906-dacc-4526-b3f6-27e5323ab8fc@n3g2000yqb.googlegroups.com> <12chb4kbqt9ln$.zumsv1z9hqvk$.dlg@40tude.net> <292dd0bd-1fc4-4715-bb70-7655d0dc04eb@j24g2000yqa.googlegroups.com> <1ffdzc3fkapks$.15g452pvvgrem$.dlg@40tude.net> Date: Wed, 29 Sep 2010 15:41:00 +0200 Message-ID: NNTP-Posting-Date: 29 Sep 2010 15:41:00 CEST NNTP-Posting-Host: f0845f4c.newsspool2.arcor-online.net X-Trace: DXC=2Y<5CH7;eO3lIh70@7enW;^6ZC`4\`mfM[68DC3efJH96YJjQ; X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:14314 Date: 2010-09-29T15:41:00+02:00 List-Id: On Wed, 29 Sep 2010 05:22:59 -0700 (PDT), Maciej Sobczak wrote: > On 29 Wrz, 11:16, "Dmitry A. Kazakov" > wrote: > >> I see no unsafety. References are maintained by the object itself. It is >> the safest possible way. [I presume that the scope of the list heads >> encloses ones of the objects.] > > This would create circular dependency between Object and Registry's > internals. You add one derived type to either of the hierarchies and that breaks the dependency. You have to with or without access types. The dependency is here, the "limited with" kludge does not remove it. > That is, Registry refers to Object (to fulfill the design > objective) and Object refers to Registry (to implement the automatic > unregistration). Yuck. Object would call a class-wide operation of Registry from its Finalize. > Note also that Object is an interface. I customary derive first abstract root type if I forced to use interfaces (I dislike interfaces). > I don't control the concrete > implementation - in particular I don't implement the factory > (constructor function). You declare the factory function abstract to be implemented by derived types. > Similarly, I don't implement the finalizer and I don't even want to > impose Controlled on the concrete type - that would not only expose > implementation mess in the public API, but also prevent me from using > interfaces. Good bye multiple inheritance, for example. That should be decided for each concrete case. Something close to MI could be achieved by using storage pools. But API infested by pointers is the worst thing to imagine. > The solution that you propose is not only very complex, I don't see how removing a type could add complexity. It didn't add new operations, it only moved access types elsewhere. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de