home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!haven.umd.edu!darwin.sura.net!mips!pacbell.com!UB.com!igor!thor!rmartin
- From: rmartin@thor.Rational.COM (Bob Martin)
- Newsgroups: comp.lang.c++
- Subject: Re: Novice? question: Designing for mul
- Message-ID: <rmartin.712271000@thor>
- Date: 27 Jul 92 21:03:20 GMT
- References: <1992Jul9.144630.10863@clpd.kodak> <1992Jul17.163022.28974@ucc.su.oz>
- Sender: news@Rational.COM
- Lines: 64
-
- maxtal@extro.ucc.su.OZ.AU writes:
-
-
- |In article <rmartin.711299360@thor> rmartin@thor.Rational.COM (Bob Martin) writes:
- |>
- |>But as I explained in a previous posting, mixin of pure virtual
- |>functions through DAGs is not precluded, the derived class must simply
- |>resolve the ambiguities by declaring the functions and routing them to
- |>the appropriate base. Inconvenient, but not a disaster.
-
-
- | And there are no ambiguities PLEASE read the section
- |in the ARM on name dominance, look at the examples
- |of sibling calls given there, and THEN read the definition
- |of abstract classes.
-
- As I explained in my previous posting, the ambiguity is in the ARM.
- It does not make it clear whether inheriting a pure virtual function
- from one side of the DAG is overriden by an impure virtual function on
- the other side of the DAG.
-
- Oh it makes sense to do this, maybe. But the ARM leaves the question
- open.
-
- |This whole issue was argued out before. I started it.
- |Borland agrees it is a bug to be fixed. Others have
- |confirmed that this makes sense. How else could
- |you possibly interpret the definition of
- |ABSTRACT class?
-
- An abstract class is a class with a pure virtual function, either
- specified or inherited. If you are inheriting from two classes, one
- of which has a pure virtual, and the other has the same virtual
- function, but impure, should be base be abstract or not? Is the pure
- virtual inherited, or are impure virtuals inherited preferentially to
- pure virtuals.
-
- I am leaning with your interpretation, that the impure should be
- inherited preferentially, and that the class should not be abstract.
- But I don't think the issue is as clear cut as you claim. For
- example, I could pose the following argument:
-
- In any case where a pure virtual and an impure virtual can be
- inherited through separate branches of the DAG, the pure virtual
- should have preference since it makes an unambiguous statement that
- the function should be overridden in the *derived* class. Since
- inheriting the impure is not the same as overriding, it should not be
- inherited.
-
- Maybe you don't agree with that argument. I am not sure I do either.
- But it does demonstrate that the issue could be debated.
-
-
-
- |--
- |;----------------------------------------------------------------------
- | JOHN (MAX) SKALLER, maxtal@extro.ucc.su.oz.au
- | Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
- |;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
- --
- +---Robert C. Martin---+-RRR---CCC-M-----M-| R.C.M. Consulting |
- | rmartin@rational.com |-R--R-C----M-M-M-M-| C++/C/Unix Engineering |
- | (Uncle Bob.) |-RRR--C----M--M--M-| OOA/OOD/OOP Training |
- +----------------------+-R--R--CCC-M-----M-| Product Design & Devel. |
-