I have this interface...
public interface ICheckThatDocumentExistsCommand
{
bool Execute( string userId, string docId );
}
In the implementation, I only want to validate the two id's and, if valid, to return the result of another interface...
public interface ICheckThatDocumentExistsCommand
{
bool Execute( UserId userId, DocumentId docId );
}
I want to define the interfaces in the same business domain assembly, but I'm having difficulty deciding how to differentiate the two (or more) layers. Logically, I perceive they are similar if not identical in name, so I can't put them under the same namespace. Do I separate via namespace? A "Validation" namespace and a "Something-else" namespace? Or do I expand the already wordy name into something a bit ridiculous like...
public interface IValidateIdsAndThenCheckThatDocumentExistsCommand
I am seeing this come up more and more as I keep functions small and single-purposed.
Not an uncommon problem using the command pattern. I can usually keep Command names to four or five words at most, but occasionally something longer is needed.
I see headaches for two interfaces with the same name:
I agree that the extra work done by the first interface should be reflected in the name. Your suggestion would work, but you could shorten it to something like
IValidateIdsAndCheckForDocumentCommand
That's not too long. :)