-
Notifications
You must be signed in to change notification settings - Fork 28
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
Consider aligning the scripting API (webIDL) with the Interaction vocabulary #127
Comments
Name changes to read, write, invoke are fine.
About events, in the TD doc it already reuses property semantics. Or do you just suggest that Event implements Observable, whereas Property should not (but instead have an |
Signed-off-by: Zoltan Kis <zoltan.kis@intel.com>
Maybe returning an observable isn't needed if the object implements observable. I'm not sure I said what I meant. For Events, we have a subscribe method rather than observe. Maybe Property has an observe method in addition to read and write, and Event has a subscribe method. That's what I think I meant... So we use the same method names in the Scripting API as the "rel" values we expose in TD |
Currently both Actually if that is the issue, since we are using our own definition of Observable, we could change the names there: use All we need to know how seriously we want to use a given vocabulary, e.g. observe/unobserve vs subscribe/unsubscribe. We seem to agree that Events should anyway use subscribe/unsubscribe. |
@mjkoster We ended up with "read" and "write" in the Bindings TF while focusing on the protocol aspects. Yet properties traditionally use "get" and "set" to perform these operations (see also https://en.wikipedia.org/wiki/Property_(programming)). Since WoT uses exactly this programming abstraction, it would be much cleaner to align in the other direction, that is, fix the terms in Interaction vocabulary -- which I expected to happen for the Korea target. |
Here I fully agree. I thought I documented this in another issue, but cannot find it at the moment. Anyhow, we should fix this for the upcoming release. |
For now, it was most important to align between TD (i.e., forms vocabular, see w3c/wot-thing-description#179) and Scripting API. For the following reasons, we decided in the call on 6 Aug 2018 to go for
I will open an issue for node-wot and do the changes there before the 0.5.0 release. |
We keep this issue open to see if we can find more and/or better reasons to decide this naming issue. |
For Properties, consider property.read(), property.write() instead of property.get() and property.set()
Also consider property.observe() which returns Observable.
For Actions, consider action.invoke() instead of action.run()
For Events, consider event.subscribe() instead of reusing observeProperty semantics. It can return Observable.
The text was updated successfully, but these errors were encountered: