我的应用程序中有以下类结构(为了时间而缩写,名称已更改)。当我编写代码时,我觉得 Action1 和 Action2 之间的相似之处应该保证某种概括。我已经提供了带有相关部分的 UML 类图(接口除外,我在下面的代码中进行了描述)。我想知道是否有人对如何制作这种“更好”的架构/类设计有想法。此外,非常相似的动作可以在近期的迭代中实现。
UML 图 http://img16.imageshack.us/img16/2569/mainmm2.jpg
接口代码
public IActor1
{
public Property1 { get; set; }
public Property2 { get; set; }
}
public IActor2
{
public Property3 { get; set; }
public Property2 { get; set; }
}