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

Why does User constructor accept a RestClient? #69

Open
JamesGold23 opened this issue Jun 10, 2014 · 1 comment
Open

Why does User constructor accept a RestClient? #69

JamesGold23 opened this issue Jun 10, 2014 · 1 comment

Comments

@JamesGold23
Copy link
Contributor

I think every User instance should create and maintain its own RestClient. An outside user shouldn't be responsible for passing one in; that's an implementation detail.

I also want to note that the examples in the README don't pass in a RestClient, but as it currently stands the code requires it.

@raulrene
Copy link
Contributor

@JamesGold23 we intend to create a wrapper over all the functionality, something like a jReddit class, which will eventually be used by the end-user. They will have access to all the functionality of the library through that class, so they won't have to bother with such things as creating rest clients and passing them wherever needed.
I think that will resolve this issue, although I somewhat agree with you. On the other hand, as the current implementation stands, it's more of a overhead to create and maintain restClient instances throughout the application, as not only the User class uses it, and this will create too many unneeded and redundant objects. Moreover, we shouldn't code for this if we plan on creating the wrapper.

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

2 participants