Sometimes classes become far too intimate and spend too much time delving in each other’s private parts.
I was laughing my heart out when I read that line in Refactoring: Improving The Design Of Existing Code by Martin Fowler.
Apart from making a point of one should avoid “over intimacy” between class, that paragraph trigger a memory of a colleague trying to explain “friend” class in C++ to me a little over seven years ago, he says:
Imagine you have Boy class A and Girl class B, obviously they can only touch on each other’s public methods, however, if you grant “friend” Boy class A and Girl class B to become Boy friend class A and Girl friend class B, then this newly relationed class will be able to touch each other’s private parts.
You get the idea?