One value of the data-hiding is that it isolates the implementation from
the functionality.
So for example if you have
// Silly example
class someClass
{
string fullName;
// ...
public:
//...
string getName() const;
void setName(const string &newName);
// ...
};
class fullClass: public someClass
{
string address;
// ...
public:
// ...
string getAddress() const;
void setAddress(const string &);
// ...
};
Now imagine that one day for some reason, you decide to change fullName
to char *. All you have to do is modify someClass::getName() and
someClass::setName().
Had you reimplemented these member functions and in general allowed
access to fullName in all derived classes, you should modify all of them.
However there are cases when it is good to have this access. There is no
"silver bullet".
Have a look here about "silver bullets":
http://www.itworld.com/AppDev/710/lw-02-stroustrup/page_1.html
And here about "separate concerns":
http://www23.brinkster.com/noicys/docs/blk.htm
As TC++PL 3 says at the end of chapter 12:
"Keep the representations of distinct concepts distinct; §12.4.1.1.".