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

Should we refactor getThingDescription to a JS getter? #507

Open
relu91 opened this issue Oct 2, 2023 · 2 comments
Open

Should we refactor getThingDescription to a JS getter? #507

relu91 opened this issue Oct 2, 2023 · 2 comments
Labels
API-improvement Suggestions for changing the API

Comments

@relu91
Copy link
Member

relu91 commented Oct 2, 2023

Currently, we are using a method but we could use a simple getter interface. There was some discussion on this point that we might dig up.

@relu91 relu91 added the API-improvement Suggestions for changing the API label Oct 2, 2023
@relu91
Copy link
Member Author

relu91 commented Oct 2, 2023

Call 02/10:

  • @JKRhb Nowadays we have getters in JS, and I think this method is better if designed as such
  • @zolkis prefers the method so that we can clearly convey the fact that additional steps might be done to create the ThingDescription in response. WebIDL supports getters and there are APIs that use them.
  • @relu91 seconds that the method is better to convey to the API users that the call can cause some computation and it is not zero cost. We should look to other APIs too.

@danielpeintner
Copy link
Contributor

I also think a methods makes more sense since

  • computation might happen
  • it is not required that the internal structure of a thing object matches the TD structure (it is the case in node-wot but there is no need/requirement for that)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API-improvement Suggestions for changing the API
Projects
None yet
Development

No branches or pull requests

2 participants