您的位置:首页 > 其它

私有类数据模式(Private class data pattern)

2010-04-29 08:03 253 查看
The private class data design pattern seeks to reduce exposure of attributes by limiting their visibility. It reduces the number of class attributes by encapsulating them in single Data object. It allows the class designer to remove write privilege of attributes that are intended to be set only during construction, even from methods of the target class

这种私有的数据类程序设计模式的目的,通过控制一些属性的可见性,来减少暴露在外的属性的数量。由于把这些类的属性包装到一个数据对象中,可见的类的属性就减少了。类的属性的赋值就只能在实例化时完成,目标类的方法也不能对这些属性的值进行操作。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: