I recently stumbled upon Clean Architecture, Uncle Bob, and I'm curious to see if Interactors can run other Interactors.
For example, these are my Interactors at the moment: getEmptyAlbums, getOtherAlbums. Both have callbacks that return with a list of albums (the ArrayList model for the album), respectively.
Am I allowed to have an Interactor named getAllAlbums that runs the previous two Interactors inside this launcher?
@Override
public void run() {
getEmptyAlbums.execute();
}
void onEmptyAlbumsReceived(ArrayList<Album albums){
getOtherAlbums.execute;
}
void onOtherAlbumsReceived(ArrayList<Album albums){
mMainThread.post(new Runnable() {
callback.onAlbumsReceived(albums);
}
});
source
share