home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.c++:11477 comp.std.c++:940
- Path: sparky!uunet!pmafire!news.dell.com!swrinde!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!csn!cherokee!io!glw
- From: glw@io.uswest.com (Glenn Williams)
- Newsgroups: comp.lang.c++,comp.std.c++
- Subject: Re: run-time type checking (was: Re: Covariant Types in Derived Classes)
- Message-ID: <1992Jul24.143359.3602@advtech.uswest.com>
- Date: 24 Jul 92 14:33:59 GMT
- References: <1992Jul21.162659.25474@ucc.su.OZ.AU> <1992Jul22.022218.1115@cadsun.corp.mot.com> <1992Jul23.154254.5306@ucc.su.OZ.AU>
- Sender: glw@io (Glenn Williams)
- Organization: US WEST Communications
- Lines: 49
- Nntp-Posting-Host: io.it.uswc.uswest.com
-
- >(John MAX Skaller) writes:
- >
- > Given the need to do downcasting, to do it safely run-time
- >type information is required. But I am arguing it is not necessary
- >to downcast. So the question of needing run-time type info to
- >do it doesn't arise.
- >
- >We design our systems properly in the first place, and then the need
- >to downcast never arises, when our thoughts wander in that
- >direction one can be sure we are not thinking virtuously,
- >and perhaps the design itself is flawed.
- >
-
- Ok, let's have an example of a properly designed system.
-
- > Inother words, in a *domestic* system, any apparent
- >need for downcasting should be used as an indicator of flawed design.
- >
-
- What is the basis for your conclusions?
-
- >class Animal {
- > int mate(Animal&);
- >};
- >class Dog : Animal {
- > int mate (Animal&);
- >};
-
- >We REALLY want Dog::mate(Dog&), but we can't have it.
-
- >This is a flaw in Object Oriented Programming IMHO.
- >The solution requires multimethods which are inherently
- >functional.
-
- What?
-
- You have stated all this before, and every time you do, you fail to provide
- any examples of how you would design without downcasting.
-
- So, as I asked for earlier, let's have an example of a properly
- designed system.
-
-
-
- Glenn Williams
- US WEST
-
-
- "Y'er spookin' the cattle." - Curly
-