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

[DESIGN] Improve DX/UX of the public APIs #91

Open
2 tasks
webknjaz opened this issue Jul 8, 2020 · 1 comment
Open
2 tasks

[DESIGN] Improve DX/UX of the public APIs #91

webknjaz opened this issue Jul 8, 2020 · 1 comment
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed

Comments

@webknjaz
Copy link
Member

webknjaz commented Jul 8, 2020

  • Define the public APIs
  • Separate internal APIs

Thoughts 💭

  1. It's not clear what are the usage scenarios of the lib (API-wise).
  2. It is too low-level (mostly).
  3. Most of the exposed classes implement managing resources and require calls to open/connect and close/disconnect. The idiomatic way of working with them is to implement context manager interfaces that guarantee that the managed resources are closed once unneeded, no matter what.
  4. The usage sequence seems to require passing extra initialization params to the connect method. This is an antipattern: objects must be ready to use right away after the initialization. So things like credentials should be passed to init, not connect.
@webknjaz webknjaz added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed labels Jul 8, 2020
@ganeshrn
Copy link
Member

Agreed the current API's are low level and we can add client class with context manager that handles session creation/deletion and command execution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants