Re: [w3ctag/design-reviews] Web of Things (WoT) Architecture (#355)

Thanks @kenchris .
The partial WoT interfaces come from the conformance classes (same reasoning and similar formulation as with the Presentation API). One can implement client, server and discovery in any combination. 

The API has to be implementable in constrained environments, which usually have ECMAScript 5.1 and Promise backport. 

readAllProperties() denotes a contract to read the state (as of multiple Properties) in one transaction. That is translated to a specific protocol request in a supported IoT deployment. That is the async part. Fetching the properties from the reply (as an object) is synchronous.

Emitting a WoT Event is again slightly different than emitting a JS event. You are right that properties and events have meanings in various contexts, that is why we defined their WoT specific counterparts in the WoT context. It might indeed be confusing, however this part should be discussed in the WoT Architecture and Thing Description, since the scripting API just follows the terms as defined there.

However, discovery could in theory be modeled with an async iterator, the problem is again semantics: the discovery-next() MAY issue a protocol request and wait for the answer. 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/355#issuecomment-509640176

Received on Tuesday, 9 July 2019 13:23:47 UTC