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=ham 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!news2.google.com!goblin1!goblin3!goblin.stu.neva.ru!gegeweb.org!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Limited use for limited with? Date: Tue, 5 Oct 2010 02:35:46 -0500 Organization: Jacob Sparre Andersen 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: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1286264149 18888 69.95.181.76 (5 Oct 2010 07:35:49 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 5 Oct 2010 07:35:49 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 X-RFC2646: Format=Flowed; Original Xref: g2news1.google.com comp.lang.ada:14389 Date: 2010-10-05T02:35:46-05:00 List-Id: "Maciej Sobczak" wrote in message news:f059316d-9994-4ea4-b984-f9530768bfbc@d25g2000yqc.googlegroups.com... ... > 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. But the Registries are completely unsafe! They have no way to protect against dangling pointers, so any client mistake (and clients make *lots* of mistakes) will cause the entire system to crash or malfunction. (And this will be the worst kind of crash, with no possible way to finding where it came from, since the crash will occur long after the actual error and not be tied to it in any way.) It's always better to prevent abuse in the interface. And in this case, I don't think you have any choice unless you are willing to assume that your clients are perfect (ha!). Storing arbitrary general access values is no safer than storing a link to an object without finalization protection. You shouldn't do either one of them. Unless you like to spend many hours in a debugger, single-stepping your code, you will find some way to protect the registries against the possibility of dangling pointers. And that is going to require some sort of cooperation (or deep copies, which I agree will often not work). Randy.