home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!mole-end!mat
- From: mat@mole-end
- Subject: Re: Novice? question: Designing for multiple inheritance w/ templates
- Message-ID: <1992Jul21.131054.20622@mole-end>
- Organization: :
- References: <1992Jul9.144630.10863@clpd.kodak.com> <1992Jul20.152931.8037@ucc.su.OZ.AU>
- Date: Tue, 21 Jul 1992 13:10:54 GMT
- Lines: 41
-
- In article <1992Jul20.152931.8037@ucc.su.OZ.AU>, maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
- > In article <1992Jul19.233851.15525@mole-end> mat@mole-end writes:
- >
- > >... From what I can tell, virtual inheritance is principally useful
- > >for importing what might be called `object representation behavior,'
- > >e.g. printability, special allocation and deallocation, etc.--things
- > >that are related to the representation OF the object, rather than to
- > >what the object itself represents.
-
- > Quite the opposite I find. Its prinicple use is in
- > deriving new abstractions from old.
- > A golden rule is : ALL ABSTRACT BASES SHOULD BE INHERITED
- > PUBLIC VIRTUAL.
- > IMHO almost every public derivation ought to be virtual.
- > Public virtual derivation with abstract classes is used to
- > make a multi-faceted abstraction.
- > Because the derivation is virtual, you can hook in implementations
- > of the various abstractions of combinations of them at the last minute:
- > late binding of implementation details. These details [should] usually
- > be bound in to a class with local scope (or file scope) ... guaranteeing
- > all access is dependent on the abstract properties of the object only.
- > This mechanism ... and guarrantees the run-time type of the object
- > can ONLY be be accessed via declared virtual functions.
- ...
- > A new optimisation technique (like caching) can be
- > hooked in, on an object by object basis, at construction time.
-
- This is exactly what I was saying. The thing added by Virtual MI is added
- not for the sake of what the class represents, but for the sake of the
- class representation. It doesn't represent something in the problem
- domain and won't appear on an object-occurrence or class-relationship
- diagram. Instead it provides something that belongs to the solution domain,
- to the properties of the programmatic object rather than the analysis
- object.
-
- Or do I misunderstand you completely?
- --
- (This man's opinions are his own.)
- From mole-end Mark Terribile
-
- uunet!mole-end!mat, Somewhere in Matawan, NJ
-