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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: I'm facing an issue with: call to abstract procedure must be dispatching Date: Tue, 8 Dec 2015 22:08:47 +0100 Organization: cbb software GmbH Message-ID: References: <8bc7fd76-f00a-4eea-9715-470af028fc84@googlegroups.com> <1krm4xun4e4ny.jmh9kvf6s0a9.dlg@40tude.net> <12dc7aea-933d-4271-95bd-10df808917e4@googlegroups.com> <5hfb2q9imjfu.zs3xp9gxw0d3.dlg@40tude.net> <5788b259-8886-4ee2-8c3d-7799abfd840e@googlegroups.com> <14acd8b0-a5e9-40fd-b7cc-d319f914d507@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: Sfz0eNwKWh4Uq03iti+GMw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:28719 Date: 2015-12-08T22:08:47+01:00 List-Id: On Tue, 8 Dec 2015 12:21:31 -0800 (PST), Serge Robyns wrote: > At times it proves to be helpful to write a sample test to clear away the > clutter. Actually the whole issue appeared because I've been introducing > the members to the T_Abstract_Data_Store as following: > > type T_Abstract_Data_Store is abstract tagged limited record > Clients: access T_Abstract_Client; -- was missing 'Class > Store2 : access T_Abstract_Store2; -- was missing 'Class > ... If you really need mix-in then better do it like this: type T_Abstract_Data_Store ( Clients : not null access T_Abstract_Client'Class; Store2 : not null access T_Abstract_Store2'Class ) is abstract tagged limited record This would add a bit more safety, much needed when using access types. > Now to go back to the overall solution. This is one of the rare cases > where multiple inheritance would have made things easier, as then the non > abstract class would "inherit" from the parents the respective > implementations like in C++ class T_Store : public T_Store1, public > T_Store2, .... Then I could just write "A_Store.Insert (Client);" as this > was my original code as I had "glue" code in the body of T_Store package, > overriding all the interfaces. Why MI is needed here? Of which of two stores is Insert? There is an ugly method of achieving poor-man's full MI. Full means that you inherit multiple implementations rather than only interfaces. The latter is allowed in Ada. The method is that you inherit one implementation normally and add others through a generic. I don't want to describe it, because it is really ugly as anything that involves generics. I am not sure you need full MI in first place. > I know that this statement will spark some discussions between the two > "camps" as per Jeffrey's comment. There are people in c.l.a who believe in procedural decomposition and inference from the type structure. It is incompatible with fundamental Ada's principles of strong typing and separation of interface and implementation. But that is my opinion. > My only long term concern is how many people can program in Ada? If you do, that is one man more... Any language lives by people who want to use it. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de