在下面的场景中是否有使用接口的设计指南?
我可以在DerivedClass或ISomeInterface接口或两者中声明IDescription.3个选择,什么指导方针可以帮助我确定哪个是最好的.
public interface IDescription
{
String Description { get; }
}
public interface ISomeInterface
{
String Name { get; }
String Description { get; }
}
public class DerivedClass : Base, ISomeInterface, IDescription
{
public String Description { get; private set; }
}
Run Code Online (Sandbox Code Playgroud)