v

    Vikas Singh

    1 week ago
    Is it good to have a use case depending on another use case where the other use case is just forwarding the calls to the repository ?
    m

    Marko Novakovic

    1 week ago
    if it’s the pattern to have usecases that are just delegating calls to repository and you already have usecase that does what you need than it’s ok to depend on it
    it’s ok for a usecase to depend on another usecase
    K Merle

    K Merle

    1 week ago
    I agree with @Marko Novakovic. It's just a high lvl code and doesn't break unidirectinal flow
    v

    Vikas Singh

    1 week ago
    What if in future I add a business logic to the usecase which is now just forwarding the calls to repo..
    K Merle

    K Merle

    1 week ago
    It depends what kind of logic and in what situation.
    m

    Marko Novakovic

    1 week ago
    just don’t duplicate code. if you end up adding code to some usecase that you depend on and it’s not suitable any more for some other usecase, create new usecase or call repository directly
    don’t overcomplicate 🙂
    v

    Vikas Singh

    5 days ago
    I was thinking of not having a usecase just to forward the calls to repo instead directly call the repository The current usecase class UseCaseA(val usecaseB: UseCaseB) { fun execute() { useCaseB.saveData() } } In the above example usecaseB is just forwarding the calls to repo instead i would prefer to directly inject the repository