[Exceptional C++ Style] Item 14: Order, Order!

Kevlin Henney kevlin at curbralan.com
Tue Dec 14 10:28:49 EST 2004


In message <ABEFILAMAIBCHBLPJDEKIEDACDAA.SamS at helpIT.com>, 
SamS at helpit.com writes
>>
>> In this context I would not expect to be talking about data members as
>> it wouldn't make as much sense -- it would not be the same or a
>> related topic of discussion. As we started talking about friendship,
>> the notion was the dependency that a piece of executable code could
>> have on a class. Hence the concern about relationship strength and
>> breadth. Friendship can be granted to types and functions, and it is
>> these that would be granted access privileges. The related member
>> concept is member functions and nested classes, not data members.
>>
>I beg to differ; it does make sense to talk about data membership in this
>context as we were talking about friendship vs membership vs inheritance.
>Inheritance and containment/membership are two types of class relationships,
>where the inheritance relationship results in stronger binding then the
>containment relationship. So, from my perspective there was plenty of room
>for misunderstanding what type of membership we were speaking about.

Ah, yes, I see the source of confusion: the containment by 
value/reference/pointer is indeed a question that comes up in the 
context of many discussions of inheritance (and, IIRC, Herb has covered 
this topic in each of his books). However, that is a slightly different 
containment and membership question. The question here is not so much 
about the question of object relationships (eg pointer) vs class 
relationships (eg inheritance) as one of scoping and access.

Kevlin
-- 
____________________________________________________________

   Kevlin Henney                   phone:  +44 117 942 2990
   mailto:kevlin at curbralan.com     mobile: +44 7801 073 508
   http://www.curbralan.com        fax:    +44 870 052 2289
   Curbralan: Consultancy + Training + Development + Review
____________________________________________________________



More information about the Effective-cpp mailing list