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,436e4ce138981b82 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-03-11 08:18:16 PST Path: archiver1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!tar-meneldur.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: abstract sub programs overriding Date: Thu, 11 Mar 2004 17:28:55 +0100 Message-ID: References: <1078839257.157439@master.nyc.kbcfp.com> <5cmr40t76va200betf07b7bd6er05ltto9@4ax.com> <1078845298.702789@master.nyc.kbcfp.com> <0ipr40thtf86b520a0qdi003aj87gtuhd4@4ax.com> <1078849973.701176@master.nyc.kbcfp.com> <1078924150.268074@master.nyc.kbcfp.com> <1079014276.527406@master.nyc.kbcfp.com> <67u0505uu3gfmlt8p28e9jkaco0nljquut@4ax.com> <1079019616.621636@master.nyc.kbcfp.com> NNTP-Posting-Host: tar-meneldur.cbb-automation.de (212.79.194.119) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de 1079021894 66957043 I 212.79.194.119 ([77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:6244 Date: 2004-03-11T17:28:55+01:00 List-Id: On Thu, 11 Mar 2004 10:40:02 -0500, Hyman Rosen wrote: >Dmitry A. Kazakov wrote: >> No, this is just a contract model. > >Between what parties? Interface developer and its user >> These are different things - to have a bad design or to have a good >> one, but poorly coded one. > >You want your language to help you catch the poor coding. That's why >Ada catches bounds errors, for example. Exactly >> You cannot do it right if the language does not support object >> construction properly. > >The concept of two-phase initialization is a backward step in OO. If that would be true, no C++ library would have Init() in each and other class. >The paradigm of C++'s *tor mechanism is that other methods don't >ever need object validity checks, because constructors make the >object kosher. But they cannot do it, when dispaching methods need to be called as a part of base specific object construction. >> I tried to show that the source of the problem is that to construct T >> /= to construct T'Class. > >This makes no sense. Any primitive operation (method) can be either dispatching or class-wide. So a constructor / destructor. This a programmer's choice, not one of the language, if one wishes to make some parts of constructor overridable (=dispatching), some not (=specific), and some common for all descendants (=class-wide). > A general object, in the OO world, may have each >derived class require services from its base class, even during object >construction. Bases may need to invoke services from derived classes, >such as in the template method design pattern. When the latter is >invoked from the former, problems arise. I have no idea what this has >to do with being classwide or not. It quite obvious: "To invoke a service from a derived type" is a more complicated way to say "to dispatch". But dispatching is possible on class-wide objects only. -- Regards, Dmitry Kazakov www.dmitry-kazakov.de