【发布时间】:2016-05-02 20:38:02
【问题描述】:
我有一个关于“私有数据类设计模式”的问题。
是否可以在“私有数据类设计模式”中同时拥有对数据类的 get 和 set 访问器。像下面那个
public class CircleData {
public double Radius { get; set; }
public Color Color { get; set; }
public Point Point { get; set; }
}
public class Circle {
public void Draw(CircleData circleData)
{
// Perform the draw operation
}
}
这里我试图消除方法和属性(properties)之间的耦合 这是“私有数据”设计模式吗?
【问题讨论】:
标签: design-patterns