I was just looking into the source code of an existing project which uses nHibernate and found that there are interfaces created for each entity classes. E.g ICustomer for Customer class. I was just wondering what can be the advantage of this pattern as ICustomer contains mainly the properties and very few methods.
Share
I would say no. Interfaces separate behavior from implementation so that the latter can be swapped out without affecting clients of the interface.
I don’t see a need for interfaces if your domain objects won’t require different implementations. Only introduce them if dynamic proxy generation or aspects or changing implementations are necessary.