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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM 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!postnews.google.com!d17g2000yqm.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Limited use for limited with? Date: Wed, 29 Sep 2010 05:22:59 -0700 (PDT) Organization: http://groups.google.com Message-ID: 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> NNTP-Posting-Host: 137.138.182.236 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1285762979 14046 127.0.0.1 (29 Sep 2010 12:22:59 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 29 Sep 2010 12:22:59 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: d17g2000yqm.googlegroups.com; posting-host=137.138.182.236; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:14313 Date: 2010-09-29T05:22:59-07:00 List-Id: 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. That is, Registry refers to Object (to fulfill the design objective) and Object refers to Registry (to implement the automatic unregistration). Yuck. Note also that Object is an interface. I don't control the concrete implementation - in particular I don't implement the factory (constructor function). For this reason I cannot do what you propose. 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. The solution that you propose is not only very complex, it also introduces new problems that would have to be addressed and that would make the API much more difficult to use. > The point is that it is a good advise not to expose both referential types > and the object types in public interfaces. I don't see any explanation of this advice. The solution with explicitly defined access types seems to be the simplest one, as it is the least intrusive with respect to the system design. -- Maciej Sobczak * http://www.inspirel.com