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

Kevlin Henney kevlin at curbralan.com
Mon Dec 13 08:34:37 EST 2004


In message 
<C3571D9EA82596468B7C6D662C82B824051C52AB at RED-MSG-32.redmond.corp.microso
ft.com>, Herb Sutter <hsutter at microsoft.com> writes
>
>>Inheritance is a significantly stronger coupling relationship than
>>friendship. At least Herb is consistent in getting the ranking slightly
>>wrong, as it this ranking is mentioned in other books.
>
>When I say that friendship is the strongest relationship, I'm thinking
>of the dependency on the class's members. Regular code depends only on
>the public parts, derived classes depend on the public and protected
>parts, and friends depend on the public, protected, and private parts.
>
>So I argue that it is the strongest relationship, while agreeing with
>the following that it is not the most pervasively visible relationship.
>There's a difference between being the strongest link and being the most
>consequential/visible link.

In that case it is a definition that you should make explicit, because 
the definition of strength is otherwise unqualified and people will fall 
back on the associations normally used when describing relationship 
strength and thoughts of coupling, cohesion and dependency management in 
general. However, even after clarifying the terminology, friendship 
still ranks second: membership is a stronger binding.

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