Reputation: 2469
If one creates interfaces for DAOs/repositories, how would you deal with entities? For example, if WidgetDaoImpl (which implements the interface WidgetDao) does CRUD operations on Widget objects, the interfaces and entities reside in different modules (e.g. "api" and "domain", respectively). It wouldn't make sense for the module api to have a dependency on domain, so how would you reconcile that?
Upvotes: 0
Views: 134
Reputation: 7894
From what you have described, you cannot avoid the dependency between the DAO interface and the data entities. The data entities describe the data you are working with so it makes perfect sense for them to be on the data tier interface.
Upvotes: 1