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!d25g2000yqc.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Limited use for limited with? Date: Wed, 29 Sep 2010 13:51:53 -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: 85.1.217.101 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1285793513 21789 127.0.0.1 (29 Sep 2010 20:51:53 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 29 Sep 2010 20:51:53 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: d25g2000yqc.googlegroups.com; posting-host=85.1.217.101; 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:14319 Date: 2010-09-29T13:51:53-07:00 List-Id: On 29 Wrz, 15:41, "Dmitry A. Kazakov" wrote: > > 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. Not at all. In my design Object knows nothing about registry. There is no such dependency and therefore it does not have to be broken. You have introduced this dependency, but this is one of the many reasons why I don't like your solution. > The dependency is > here, the "limited with" kludge does not remove it. The motivation to use "limited with" came from other reasons, which are not directly related to registry. > Object would call a class-wide operation of Registry from its Finalize. This assumes that Registry is object-oriented and that all registries have some common interface. I don't want this assumption, it does not reflect any system requirement. > > 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. And how can I enforce that user will properly use the registry from the constructor? I cannot assume this. I don't even want to impose the existence of any factory functions - they are not needed as far as Object and Registry are concerned. You have introduced this concept artificially as part of your solution, but it does not reflect any design objective. This is yet another reason why I don't like it. > > The solution that you propose is not only very complex, > > I don't see how removing a type could add complexity. In order to "remove a type" you have introduced: - factory functions, perhaps abstract - Controlled with Finalized - circular dependencies between Object and Registry (ironically, you have then proposed to introduce *another derived type* to break that dependency - does it still count as "removing a type"?) - common tagged root for all registries (this seems to be also an additional type) - storage pools (?) As far as I'm concerned, your solution evolved to a monster. I therefore stick to my single access type. :-) -- Maciej Sobczak * http://www.inspirel.com