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

isRegistered should return the endpoint itself rather than a boolean #5

Closed
prudentbot opened this issue Jul 3, 2014 · 0 comments
Closed

Comments

@prudentbot
Copy link

The way the current specification is defined, a developer would call isRegistered and, if the application is already registered, they then call register to obtain the endpoint. The problem I see is that this results in a redundant query to local storage, one to check if the record exists (which is thrown away), and then, in most cases, one to obtain the record.

If we made it so that isRegistered returned the result of that query rather than true/false, it would still perform the service of checking to see if the endpoint already exists, but then it would save the developer from having to call register() regardless of the result. This has the added bonus of making the call to register() be more accurately descriptive, since it would only be used if you weren't already registered, and it would be used to perform the act of registration.

I suppose this implementation would also imply a name change from isRegistered to getRegistration or something.

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