In writing my current project, I have created interfaces for all of my objects. I thought that this was considered good coding practice.
I've basically ended up with a bunch of interfaces which define pretty trivial classes.
Eg:
public interface IUser
{
int Id { get; }
string DisplayName { get; }
}
I don't really see any point to having these here. I've additionaly now run into problems in a couple of places where I want to do things like define operator overloads, which I can't do at the interface level.
I'm tempted to go through my project and remove all these interfaces (I would keep interfaces for my repositories and other such things which define more complex behaviour), but I'd be a bit gutted to be going through deleting 100s of lines of code and all the refactoring that will go with it.
I'd like to hear opinions of other users here. Is there any purpose to defining interfaces on basic objects? Is there any harm in having them there, even if they aren't really necessary?