我有这个界面...
public interface ICheckThatDocumentExistsCommand
{
bool Execute( string userId, string docId );
}
在实现中,我只想验证两个 id,如果有效,则返回另一个接口的结果......
public interface ICheckThatDocumentExistsCommand
{
bool Execute( UserId userId, DocumentId docId );
}
我想在同一个业务域程序集中定义接口,但我很难决定如何区分两个(或更多)层。从逻辑上讲,我认为它们即使名称不同也相似,因此我不能将它们放在同一个命名空间下。我是否通过命名空间分开?“验证”命名空间和“其他”命名空间?或者我是否将已经罗嗦的名字扩展成有点可笑的东西,比如......
public interface IValidateIdsAndThenCheckThatDocumentExistsCommand
随着我保持功能小且用途单一,我看到这种情况越来越多。