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,29d8139471e3f53e X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!i5g2000yqe.googlegroups.com!not-for-mail From: Cyrille Newsgroups: comp.lang.ada Subject: Re: Preventing type extensions Date: Thu, 30 Sep 2010 03:08:02 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <87iq2bfenl.fsf@mid.deneb.enyo.de> <8f6cceFrv2U1@mid.individual.net> <135a7dc9-3943-45e4-884b-3cc6bce3db0a@q18g2000vbm.googlegroups.com> <81799aab-a2e8-4390-8f42-abceaa5fc032@m1g2000vbh.googlegroups.com> <5c0d7798-ba09-4bd0-a28f-f1b028cce927@y3g2000vbm.googlegroups.com> <9df21c09-f611-4088-811c-c092452adffc@e20g2000vbn.googlegroups.com> <37ae2382-9f7d-4790-be5f-e380b9220d75@s19g2000vbr.googlegroups.com> NNTP-Posting-Host: 212.99.106.125 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1285841283 16890 127.0.0.1 (30 Sep 2010 10:08:03 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 30 Sep 2010 10:08:03 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: i5g2000yqe.googlegroups.com; posting-host=212.99.106.125; posting-account=bNhsVwoAAAB6XmNPWgYcbUm6npIwL2C4 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10 ( .NET CLR 3.5.30729),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:14332 Date: 2010-09-30T03:08:02-07:00 List-Id: On Sep 29, 6:47=A0pm, "J-P. Rosen" wrote: > Thanks for the pointers, but they seem to be quite close to what I am > suggesting my point is that those ideas are not new and in fact not that relevant anymore since they don't solve anything. > Not at all, but I may not have clearly explained my line of reasoning. > 1) (Most important) I think that a method should really be a "method", sure a method should be a method. I think it won't be hard to have a general agreement on that ;-) > i.e. an abstract operation that is implemented in different ways by > different objects belonging to a class; i.e. all drawable objects have a > "paint" method, but each objet has its own way, its own /method/, of > painting itself. Since this is closely linked to a single member of a > class, there is no reason to redispatch in such a method. if there is no reason to use the other methods of the same tagged type in the method in question, there is no issue of redispatch anyway. if there are such uses and they are done through non-dispatching calls, then there are real vulnerabilities and they should be addressed. There is no way around that. > 2) There is often a need to provide higher level operations, that are > /not/ methods, but that are generally implemented by a combination of > methods: Move=3DErase, change position, Draw. Having these as class-wide > operations rather than redispatching methods guarantees that the same > behaviour is obtained for all members of the class. if you are saying that not all subprograms should be methods, I also think you should have no problem reaching general agreement. It is true that in Ada, a subprogram that is not a method and acts on a tagged type better be a class-wide operation. > 3) I propose to enforce this strict separation, with the added benefit > that all dispatching calls are located in class-wide operations, and > thus reduce the coverage effort. what coverage effort? You seem to believe that "pessimistic testing" is mandatory... this is not the case in DO-178C as I explained in a former post. > 4) (this is the topic of my previous messages) If in some cases there is > a real need for redispatching, it is still possible to follow this > pattern by subcontracting the dispatching to a class-wide operation that > does nothing else. But this should be a rare exception. The pattern you suggest (using those wrappers) doesn't address any vulnerabilities I am aware of and doesn't help much with coverage since there are other better ways to achieve the new related objective in the DO-178C. > Note that this is quite close to Franco's approach, except that I don't > rely on a specific implementation, thus preserving portability. but all this line of reasoning has been overtaken by events. Once again, "pessimistic" testing is not the preferred way to address the new objective. So trying to make "pessimistic" testing less painful is just not that interesting anymore. > To conclude about differentiating T and T'Class, the trick you suggest > > here is easily implementable in other OO languages. There is nothing > > magic in creating a wrapper around a given dispatching call and use > > this wrapper at each dispatch point. > > The benefit of class-wide operations is that they are easily > recognizable, and therefore my proposed pattern is easily checkable by > tools (read: will appear in AdaControl as soon as I get around to it). > > I don't think it would be as easy in other languages to ensure that the > profile is followed. I don't think that (what I understand) from your profile will be very helpful in a DO-178C context but even if it was, I don't see anything difficulty in implementing it in other languages since it is just a matter of differentiating virtual methods (using C++ parlance) from non-virtual ones or non-methods...