Re: procedural vs object oriented
- From: "Ludovic Brenta" <ludovic@xxxxxxxxxxxxxxxxxx>
- Date: 27 Apr 2006 08:17:25 -0700
Alex R. Mosteo writes:
Ludovic Brenta wrote:
But with compiler-provided dynamic dispatching, there *is* uncertainty
as to how dispatching works and what the targets are.
This is something I'm not getting in this discussion. Provided that you
know all derived classes, you know all possible dispatchings and you can
validate all for correctness and time the worst one. How's this
different than evaluating all branches in a case?
It's true that you don't have the information at the calling point, but
you have it elsewhere.
The issue is not whether or not you *can* validate dispatching calls;
of course you can. The issue is *how much it costs* to do so. (This
same argument is also why we use Ada instead of C or handwritten
assembly).
As you said, the list of all possible call targets is not present at
the call site, but spread across the entire program source. You'd have
to gather the list of all possible targets for each dispatching call,
and review the dispatching machine code *at every call site*. Try to do
that on the software you're currently writing. The first step would be
for you to come up with a list of all dispatching (not static) calls in
your program. If you do just that, you will then start to realise how
much effort would be required for full-fledged certification.
Furthermore, during maintenance, more possible call targets can appear,
affecting previously tested and certified call sites, and requiring you
to redo the certification process each time you add a type to a
derivation class.
In general-purpose programming, you can use all the features of the
language that help you write your source code faster; in avionics, you
only use those that help you certify your machine code faster. It
matters more to reduce the cost of certification than the cost of
writing the software, because the former far outweighs the latter.
--
Ludovic Brenta.
.
- Follow-Ups:
- Re: procedural vs object oriented
- From: Alex R. Mosteo
- Re: procedural vs object oriented
- References:
- procedural vs object oriented
- From: Ananth the Boss
- Re: procedural vs object oriented
- From: bh
- Re: procedural vs object oriented
- From: Ludovic Brenta
- Re: procedural vs object oriented
- From: Dmitry A. Kazakov
- Re: procedural vs object oriented
- From: Ludovic Brenta
- Re: procedural vs object oriented
- From: Dmitry A. Kazakov
- Re: procedural vs object oriented
- From: Ludovic Brenta
- Re: procedural vs object oriented
- From: Alex R. Mosteo
- procedural vs object oriented
- Prev by Date: Re: Type safety, C++ and code generation
- Next by Date: Re: procedural vs object oriented
- Previous by thread: Re: procedural vs object oriented
- Next by thread: Re: procedural vs object oriented
- Index(es):
Relevant Pages
|