【发布时间】:2011-04-05 21:05:08
【问题描述】:
我对应该在哪里应用我的 XML cmets 很感兴趣。我应该在接口中添加更通用的 XML 注释,在实现类中添加更具描述性的注释吗?像这样:
public interface IObjectRepository
{
/// <summary>
/// Returns an object from the respository that contains the specified ID.
/// </summary>
Object GetObject(int Id);
}
public ObjectRepository : IObjectRepository
{
/// <summary>
/// Retrieves an object from the database that contains the specified ID.
/// </summary>
public Object GetObject(int Id)
{
Object myData = // Get from DB code.
return myData;
}
}
为简单起见,我没有包含<param>。
这对 cmets 来说是一个好习惯还是有不同的方法?我只是跳过评论界面吗?
【问题讨论】:
标签: c# interface documentation comments xml-comments