jeans chen
we've got them by the balls

将成员变量隐藏在函数接口的背后,可以为“所有可能的实现”提供弹性,

 

假设我们有一个public成员变量,而我们最终取消了它,多少代码可能会被破坏呢?那是一个不可知的大量。

protected成员变量就像public成员一样缺乏封装性(所有使用它的derived都会被破坏)

 

posted on 2013-08-01 14:11  jeans chen  阅读(129)  评论(0)    收藏  举报