Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!mtune!mtx5c!mtx5d!mtx5a!mat From: mat@mtx5a.UUCP (m.terribile) Newsgroups: comp.lang.c++ Subject: Re: Re: Questions about C++ (Rather Long) Message-ID: <1820@mtx5a.UUCP> Date: Fri, 26-Jun-87 02:34:22 EDT Article-I.D.: mtx5a.1820 Posted: Fri Jun 26 02:34:22 1987 Date-Received: Sat, 27-Jun-87 08:42:56 EDT References: <226@nih-csl.UUCP> <131@otc.OZ> Distribution: comp Organization: AT&T Information Systems, Middletown, NJ 07748-4801. Lines: 42 > > ... > > check its argument class you need to do it at run-time with isKindOf > > (a.k.a. "in"). > > Yes, this is annoying and I have indeed run into it myself. However, I > not sure whether such designs are really a good idea or not. (I know > lots of people do it, but that does not necessarily mean it's good > style.) My reservations are based on the fact that we are essentially > asking class Collection to do something beyond what normal Collections > do. ... More real-world usage of object-oriented techniques in critical > high-performance applications with large maintenance problems is > required. ... it IS possible to achieve a limited "isa" mechanism in > the current version of C++, for certain cases. It relies on knowledge > of what cfront generates, ... (One objection to adding this feature to > C++ proper is the run-time overhead. ... > pointer which can in principle be used if you're desperate enough.) The If run-time overhead were an issue, the ``new'' and ``delete'' operators would not have been included. The issue is far more elemental. Why do we want to use the ``is'' test? Because we want to determine something about the type structure. That means that either 1) we have encoded some information in the type structure in a manner that is not a part of the language and that violates the supported paradigms, which were carefully designed to encourage good practices, or 2) We are relying on the incidental relationships within the type structure to provide us with information we should have represented explicitly. If you *need* a method invocation, program it, ferpeetsakes and make it explicit! -- from Mole End Mark Terribile (scrape .. dig ) mtx5b!mat (Please mail to mtx5b!mat, NOT mtx5a! mat, or to mtx5a!mtx5b!mat) (mtx5b!mole-end!mat will also reach me) ,.. .,, ,,, ..,***_*.