From -5712941791436912274
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,edd477ec92e5348f
X-Google-Attributes: gidf78e5,public
X-Google-Thread: fc772,ef0c226459c03bdf
X-Google-Attributes: gidfc772,public
From: Francis Glassborow <francis@robinton.demon.co.uk>
Subject: Re: Protected Inheritance
Date: 1999/02/07
Message-ID: <zZTJ6HC3Lav2EwfK@robinton.demon.co.uk>#1/1
X-Deja-AN: 442759302
Approved: kuehl@fmi.uni-konstanz.de
Sender: cppmods@netlab.cs.rpi.edu
References: <Pine.GSO.3.95-960729.990131142619.5694B-100000@finan.ncl.ac.uk> <slrn7bbi9a.q1a.sbnaran@localhost.localdomain> <sUPt2.16333$202.8056314@news1.teleport.com> <79aesq$qlr$1@uuneo.neosoft.com> <HEbu2.18017$202.8772558@news1.teleport.com> <7sAoNOBfshu2EwFV@robinton.demon.co.uk> <hZ7v2.2348$GN.1054@news.rdc1.wa.home.com>
X-Submission-Address: c++-submit@netlab.cs.rpi.edu
X-Approved-For-Group: Fergus Henderson <fjh@cs.mu.oz.au> comp.std.c++
X-Original-Date: 07 Feb 99 16:51:14 GMT
Organization: Southfield Microcomputer SS
X-Auth: PGPMoose V1.1 PGP comp.lang.c++.moderated iQBVAwUANr3x1kHMCo9UcraBAQHG7QH/QPMlbfh0SfhNW5MLbxXpkQhf3IlL9GlZ c4r7gDYyYF2uUotJcNORPOncpe7LbtqnXBI0JbKMdudj4aQgOv1Zdg== =uHRc
Reply-To: Francis Glassborow <francisG@robinton.demon.co.uk>
Newsgroups: comp.lang.c++.moderated,comp.std.c++

In article <hZ7v2.2348$GN.1054@news.rdc1.wa.home.com>, Larry Brasfield
<clcppm-poster@this.is.invalid> writes
>I think calling that inheritance structure "a waste of
>time" is to lose sight of what is being controlled by
>making derivation private.  It is not so much to guard
>the base against outside corruption as to restrict the
>interface exposed by the derived class.  The above
>private (virtual) inheritance does that for class B.  The
>fact that class C (or its designer, more accurately) has
>chosen to expose its A base is C's (designer's) affair,
>of no concern to the design of B.  Presumably, what
>utility A had for B survives sharing (which is implicit
>in virtual inheritance) by classes that derive from B.
>That utility is independent of whether those classes
>elect to expose A as part of their interface.

My feeling is that the concept is better provided by using virtual
protected inheritance.  I guess that is a style issue, but it does I
think, warn less experienced designers that the inheritance they are
using provides less protection than they might expect.


Francis Glassborow      Chair of Association of C & C++ Users
64 Southfield Rd
Oxford OX4 1PA          +44(0)1865 246490
All opinions are mine and do not represent those of any organisation
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]




