-
Notifications
You must be signed in to change notification settings - Fork 97
Description
Hi, just stumbled with your articles on medium and had this quick question regarding the interactor pattern: is an Interactor supposed to have one and only one dependency on a repository or can actually depend on more than one?
For example: Lets suppose that we have a UserProfileInteractor
wich has only one method called GetUser
and a UserRepository
which has N methods (doesn't matter which ones for the sake of the example). Now, that user needs to belong to a Company
and that model "belongs" to its own repository called CompanyRepository
which has other methods, but specifically one called getCompany
that we'll need to invoke to assemble our user on the UserProfileInteractor
. For completeness we also have a presenter called UserProfilePresenter
which will have an instance of UserProfileInteractor
and is in charge of "presenting" the user profile displaying the user information + that user's company data.
How would you handle such a thing? Would you make UserProfileInteractor
have dependencies on both UserRepository
and CompanyRepository
? Would an interactor depending on two repositories violate the separation of concerns in any way?
Cheers and thanks for the articles, really enjoying them.