Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Api layer #305

Open
AlexITC opened this issue Jan 27, 2023 · 0 comments
Open

Refactor Api layer #305

AlexITC opened this issue Jan 27, 2023 · 0 comments

Comments

@AlexITC
Copy link
Contributor

AlexITC commented Jan 27, 2023

The current approach for invoking the backend API is somewhat annoying:

  1. We have an ApiClient, while that's a trait, we just have a specific implementation, making it a class can simplify this.
  2. Still, ApiClient implements just every method, which has lots of repetitive code and the class file gets unnecessarily long (seems one of those rare cases where the cake-pattern could be helpful0.

There is also an alternative way, what if each Api class knows how to invoke backend? this way, we could keep Api files to be self-contained.

I think that the alternative approach is worth exploring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant