I saw in a projekt many interfaces which just wrapped a generic class.
An example:
public interface IAssertionViewModelMapper : IMapper<Assertion, AssertionViewModel>
{}
public interface ISearchPageViewModelMapper : IMapper<IList<Tag>, SearchPageViewModel>
{}
Could someone explain why they did this ? I mean I can just straight implement the IMapper interface.
Microsoft Code Analysis (a.k.a. FxCop) contains a rule against doing this. However, creating a new interface like this has a few advantages:
IMapper<T, TViewModel>actually define new methods. It’s easy to spot the interfaces, even if they don’t define new members.