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

SamS at helpIT.com SamS at helpIT.com
Tue Dec 14 05:17:50 EST 2004


effective-cpp-bounces at accu.org wrote:
> In message <20041213170753.ZPVO11200.fep02-app.kolumbus.fi at EVO>, White
> Wolf <wolof at freemail.hu> writes
>>>
>>> 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.
>>
>> Why?  A member does not depend on the class containing it.
>
> Err, yes it does: that is fundamental to the definition of membership!
>
> Kevlin

Are you two talking about the same thing?

It looks like Kevlin is speaking about member _functions_ and WW about
member _data_. It is obvious to me that function membership provides the
strongest binding, but, in C++, data membership surely has a weaker binding
than both friendship and inheritance?

The enclosing object only depends on the public interface of the member
subobject and the member subobject doesn't (normally) depend on the
enclosing object at all as WW pointed out.

Sam





More information about the Effective-cpp mailing list