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,FREEMAIL_FROM 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-09 05:34:17 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!nntp.abs.net!ash.uu.net!spool.news.uu.net!not-for-mail Date: Tue, 09 Mar 2004 08:34:03 -0500 From: Hyman Rosen User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: abstract sub programs overriding References: <5f59677c.0403021101.4ac263d0@posting.google.com> <5f59677c.0403060718.3d6aa909@posting.google.com> <1078776213.376775@master.nyc.kbcfp.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Organization: KBC Financial Products Message-ID: <1078839257.157439@master.nyc.kbcfp.com> Cache-Post-Path: master.nyc.kbcfp.com!unknown@aphelion.nyc.kbcfp.com X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) NNTP-Posting-Host: 204.253.250.10 X-Trace: 1078839257 8527 204.253.250.10 Xref: archiver1.google.com comp.lang.ada:6187 Date: 2004-03-09T08:34:03-05:00 List-Id: Dmitry A. Kazakov wrote: > Yes, this is because C++ OO model is inconsistent. This is literally true, if by consistent you mean "objects have the same type from the start of construction to the end of destruction". > Nothing may change the object type Obviously this is not a fixed law of nature, but merely a choice. C++ has chosen otherwise. > otherwise artifacts will inevitable show this or that way. The artifacts that show up in the C++ model is that abstract methods may be invoked by dispatching. The artifact that is avoided by the C++ model is that methods are never invoked on unconstructed objects. It's a perfectly reasonable tradeoff, since detecting dispatch to abstract methods is trivially easy. It's the job of constructors to make an object consistent. Other methods should never have to worry that they're being called with inconsistent state.