comp.lang.ada
 help / color / mirror / Atom feed
From: Cyrille <comar@eu.adacore.com>
Subject: Re: Preventing type extensions
Date: Thu, 30 Sep 2010 03:08:02 -0700 (PDT)
Date: 2010-09-30T03:08:02-07:00	[thread overview]
Message-ID: <fda875ed-1583-4dbd-8ec2-556c0385716e@i5g2000yqe.googlegroups.com> (raw)
In-Reply-To: i7vqif$qhv$1@news.eternal-september.org

On Sep 29, 6:47 pm, "J-P. Rosen" <ro...@adalog.fr> 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=Erase, 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...



  reply	other threads:[~2010-09-30 10:08 UTC|newest]

Thread overview: 107+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-12 10:18 Preventing type extensions Florian Weimer
2010-09-12 11:59 ` Ludovic Brenta
2010-09-12 12:53   ` Florian Weimer
2010-09-12 21:23     ` Maciej Sobczak
2010-09-13  5:32       ` Florian Weimer
2010-09-13  7:13         ` Dmitry A. Kazakov
2010-09-13  9:19           ` Georg Bauhaus
2010-09-13  9:42             ` Dmitry A. Kazakov
2010-09-13 10:23               ` Niklas Holsti
2010-09-13 12:55                 ` Cyrille
2010-09-13 13:55                   ` Dmitry A. Kazakov
2010-09-13 21:13                   ` J-P. Rosen
2010-09-21 13:57                     ` Cyrille
2010-09-21 14:19                       ` Dmitry A. Kazakov
2010-09-21 14:44                         ` Cyrille
2010-09-21 16:25                           ` Dmitry A. Kazakov
2010-09-21 17:11                             ` Georg Bauhaus
2010-09-21 18:11                               ` Dmitry A. Kazakov
2010-09-23 20:00                                 ` Simon Wright
2010-09-23 20:49                                   ` Dmitry A. Kazakov
2010-09-24  9:10                                     ` Georg Bauhaus
2010-09-24 10:24                                       ` Dmitry A. Kazakov
2010-09-24 13:30                                 ` Niklas Holsti
2010-09-24 16:27                                   ` Dmitry A. Kazakov
2010-09-24 17:47                                     ` Niklas Holsti
2010-09-24 19:42                                       ` Dmitry A. Kazakov
2010-09-21 14:32                       ` J-P. Rosen
2010-09-21 15:02                         ` Cyrille
2010-09-21 15:26                           ` J-P. Rosen
2010-09-21 16:18                             ` Cyrille
2010-09-22  8:01                               ` J-P. Rosen
2010-09-22 17:28                                 ` Cyrille
2010-09-22 19:30                                   ` Ludovic Brenta
2010-09-22 19:51                                     ` Florian Weimer
2010-09-22 20:14                                       ` Dmitry A. Kazakov
2010-09-22 20:25                                         ` Florian Weimer
2010-09-22 20:38                                           ` Dmitry A. Kazakov
2010-09-22 21:25                                             ` Vinzent Hoefler
2010-09-22 21:20                                           ` Georg Bauhaus
2010-09-22 20:16                                       ` Ludovic Brenta
2010-09-22 20:34                                         ` Florian Weimer
2010-09-22 22:45                                           ` Britt Snodgrass
2010-09-23  8:02                                           ` Ludovic Brenta
2010-09-23 16:51                                     ` Pascal Obry
2010-09-23 18:37                                       ` Florian Weimer
2010-09-23 18:55                                         ` Pascal Obry
2010-09-23 20:28                                       ` Ludovic Brenta
2010-09-24  9:20                                         ` Ludovic Brenta
2010-09-24 14:49                                           ` Simon Wright
2010-09-24 15:09                                             ` Ludovic Brenta
2010-09-24 16:21                                           ` Robert A Duff
2010-09-25  7:10                                         ` Pascal Obry
2010-09-25 12:03                                           ` Brian Drummond
2010-09-24  8:16                                   ` J-P. Rosen
2010-09-24  8:39                                     ` Cyrille
2010-09-24  9:27                                       ` Cyrille
2010-09-29 16:47                                         ` J-P. Rosen
2010-09-30 10:08                                           ` Cyrille [this message]
2010-10-05 17:02                                             ` J-P. Rosen
2010-10-08  7:50                                               ` Cyrille
2010-10-08 13:58                                               ` Cyrille
2010-10-08 20:12                                                 ` Dmitry A. Kazakov
2010-10-11  7:57                                                   ` Cyrille
2010-10-11  8:24                                                     ` Dmitry A. Kazakov
2010-10-12  5:23                                                   ` Shark8
2010-10-13  9:06                                                 ` J-P. Rosen
2010-10-13 17:37                                                   ` Cyrille
2010-10-13 18:50                                                     ` Dmitry A. Kazakov
2010-09-21 14:50                       ` (see below)
2010-09-21 17:37                         ` Cyrille
2010-09-21 19:07                           ` (see below)
2010-09-13 13:05                 ` Dmitry A. Kazakov
2010-09-13 20:21                   ` Niklas Holsti
2010-09-13 21:00                     ` Dmitry A. Kazakov
2010-09-13 21:10                 ` J-P. Rosen
2010-09-14 12:16                   ` Niklas Holsti
2010-09-14 16:46                     ` Dmitry A. Kazakov
2010-09-14 18:08                       ` Niklas Holsti
2010-09-14 18:32                         ` Niklas Holsti
2010-09-15  8:18                         ` Dmitry A. Kazakov
2010-09-14 17:04                     ` J-P. Rosen
2010-09-13 15:12               ` Securing type extensions (was: Preventing type extensions) Georg Bauhaus
2010-09-13 15:29                 ` Securing type extensions Dmitry A. Kazakov
2010-09-13 17:23                 ` Simon Wright
2010-09-13 20:22                   ` Georg Bauhaus
2010-09-13 20:41                     ` Dmitry A. Kazakov
2010-09-14 10:02                       ` Georg Bauhaus
2010-09-14 12:22                         ` Dmitry A. Kazakov
2010-09-14 21:18                           ` Georg Bauhaus
2010-09-15  8:15                             ` Dmitry A. Kazakov
2010-09-15 20:47                               ` Georg Bauhaus
2010-09-16  7:47                                 ` Dmitry A. Kazakov
2010-09-16 11:52                                   ` Georg Bauhaus
2010-09-16 12:45                                     ` Dmitry A. Kazakov
2010-09-16 20:53                                       ` Georg Bauhaus
2010-09-16 21:37                                         ` Dmitry A. Kazakov
2010-09-17  8:45                                           ` Georg Bauhaus
2010-09-17  9:39                                             ` Dmitry A. Kazakov
2010-10-05  5:59                     ` Randy Brukardt
2010-09-13 18:32           ` Preventing " Florian Weimer
2010-09-13 20:30             ` Dmitry A. Kazakov
2010-09-22 19:41               ` Florian Weimer
2010-09-22 20:34                 ` Dmitry A. Kazakov
2010-09-22 21:10                   ` Georg Bauhaus
2010-09-17  0:16           ` Shark8
2010-09-17  7:04             ` AdaMagica
2010-09-17 21:05               ` Shark8
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox