You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm recently working on my android project code refactoring and I find your project.
I'm confused about using UseCase class which will be @Inject in Presentation Layer to get the data in Data Layer.
Will this be more convenient if we just @Inject the UserRepository in Presentation Layer directly, since UseCase(GetUserDetails) is just some kind of wrapping of UserRepository from my point of view.
Like this:
class UserDetailsPresenter{
private UserRepository userRepository;
...
@Inject
public UserDetailsPresenter(UserRepository userRepository){
...
}
...
//get the user detail
userRepository.user(this.userId).subscribeOn(...).observeOn(...).subscribe((data)->{});
....
}
The text was updated successfully, but these errors were encountered:
For something that simple, yes it does appear to work. However as your data sets get more complicated, a UseCase can encompass combining multiple elements from the repository, and explicitly having this layer define what repository elements create a UseCase is supposed to help it scale as necessary.
Hi, I'm recently working on my android project code refactoring and I find your project.
I'm confused about using
UseCase
class which will be@Inject
in Presentation Layer to get the data in Data Layer.Will this be more convenient if we just
@Inject
theUserRepository
in Presentation Layer directly, sinceUseCase
(GetUserDetails
) is just some kind of wrapping ofUserRepository
from my point of view.Like this:
The text was updated successfully, but these errors were encountered: