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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1116ece181be1aea X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-10 00:40:40 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!tar-alcarin.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: Is the Writing on the Wall for Ada? Date: Wed, 10 Sep 2003 09:48:10 +0200 Message-ID: References: NNTP-Posting-Host: tar-alcarin.cbb-automation.de (212.79.194.111) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de 1063179639 21527041 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:42342 Date: 2003-09-10T09:48:10+02:00 List-Id: On 9 Sep 2003 16:48:04 -0700, aek@vib.usr.pu.ru (Alexander Kopilovitch) wrote: >Combining different roles in the same object may be a good thing >as far as those roles do not interfere with each other. >But in reality they may interfere by subtle and unforeseen way, >in some singular points of the problem space. Therefore it is >generally important (for the kinds of projects, for which Ada was >primarily designed) to maintain organized responsibility among >the roles, and this naturally leads to strict prioritization of >individual role's authority and responsibility. Single inheritance >ideally provides that prioritization, while full-scale multiple >inheritance symmetrically spreads responsibilty among several >ancestors, and did not provide any guidance for resolving of >apparent conflicts between the roles. If you declare two variables with the same name in the same context, what sort of guidance you need to resolve this conflict? You need no quidance. The compiler just do not eat the code. Conflicts has to be disallowed where possible, as simple as that. (*) In both cases: MI vs. multiple variable declaration everything can be checked statically. But strangely enough, that the latter is considered OK and nobody proposes to limit the number of variables per block by one. I DO! (:-)) How nice and safe it would be. And there is a wondeful work-around when you need two variables. Make a record type! >> In Smalltalk you need an extra tool to do this, in C++ >> all you need is a little care. I suppose it *could* be done in Ada >> with generics, but I have not tried it, and it would certainly be more >> obfuscated. > >Well, sometimes it may be done with generics, but anyway you may >always use straightforward delegation instead of multiple inheritance. >In fact, a delegation adds not so much code, and do not harm readability >(assuming regular attentive reading, not a brief glance). Delegation solves nothing. It just offers you to make everything manually. How nice. But if MI is inheretly wrong, then doing the SAME thing manually, you will dicover SAME problems. Just consider inheritance as a delegation with an automatically generated proxy code. So let MI be infeasible, then delegation has to be also limited by "single delegation". But likely they both are not. Because, the problem is not inheritance per se, but the way a proxy code is generated and the way a programmer might influence this process. ------------------ (*) Unresolved, postponed conflicts are nightmare. This has nothing to do with MI. We have this nightmare in case of variable declarations too (use clauses, for example). --- Regards, Dmitry Kazakov www.dmitry-kazakov.de