Re: procedural vs object oriented



On Thu, 27 Apr 2006 16:01:41 +0200, Jean-Pierre Rosen wrote:

Dmitry A. Kazakov a écrit :

Well, no:

if Read (File) then
Foo;
else
Bar;
end if;

The uncertainty of a dispatching call is one of the context, exactly as in
the example above. Provided, that there is nothing uncertain in how
dispatching works or what potential targets do.

Of course, you can assume that every dispatching call is equivalent to a
case statement over all possibly redefined primitives. That works well
for one level.

But if you consider that each called primitive may in turn redispatch
internally, you end up with a combinatorial explosion.

Ah, but redispatch is luckily not allowed in Ada. The programmer has to
explicitly convert the type to the class. That should not slip through peer
review.

[ I would even disallow it altogether. There is your trick for such
things.]

In theory, yes, the analysis can be performed. In practice, no.

Yes, but it is a sort of "postmortem" or C-ish approach. There is nothing
fundamentally evil in dispatching if LSP problematic is supported. It is a
question of the language and tools. Something like SPARK could change it.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
.



Relevant Pages

  • Re: procedural vs object oriented
    ... The uncertainty of a dispatching call is one of the context, ... dispatching works or what potential targets do. ... you can assume that every dispatching call is equivalent to a case statement over all possibly redefined primitives. ...
    (comp.lang.ada)
  • Re: implementing roles in OOP......
    ... > differently based on some context. ... but in this context Composite seems a misnomer - can I call it ... But yes dispatching is the encapsulation of this decision (and ... but I want a 'execution' of a network to be completely decoupled ...
    (comp.object)
  • Re: The Open-Closed-from-a-certain-angle Principle
    ... could probably be done by extending the dispatching mechanism. ... the object's context. ... The idea now would be to extend this and to also allow dispatching on ... most other OO languages) already take a very simple caller context into ...
    (comp.lang.ruby)
  • Re: Flattening lists
    ... flatten generic iterables or only lists). ... this context, since I would say 99.9% of times one wants to treat them ... as atomic objects, so no need to special case. ... Dispatching ...
    (comp.lang.python)