Skip to content

Dependency Rule: UseCase depends on the ViewModel #7

Description

@darwingr

The OutputBoundaries depend on their respective ViewModels.
As a result the UseCase component will also depend on the ViewModel, though it doesn't really need to.

What are some acceptable remedies here?
So far I see:

  1. Change the return type of OutputBoundary#getViewModel() to the generic Object, use unit tests on the Presenter to satisfy doubts.
  2. Add an empty ViewModelInterface for each UseCase component to be depended on by the OutputBoundary, UseCaseInteractor and the Controller while the Presenter uses the implementation directly.
  3. Make a single empty ViewModel interface (set as immutable/sealed if possible) to be referred to in all the UseCase component. All ViewModels implement that interface and the rest is as above in # 2.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions