-
Notifications
You must be signed in to change notification settings - Fork 28
Does WoT.Request need a "type" attribute #70
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
Comments
I noticed onObserve() is a somewhat special request. I would tend to say we create a dedicated ObserverRequest without complicating the normal requests for property and actions? Not sure... Maybe we also state which Request fields are optional in the WebIDL. |
Since we haven't defined algorithms yet, perhaps it is hard to infer from WebIDL alone how things are supposed to work. So apologies for a long reply, and sorry if I will state obvious things. The When TD's include protocol binding descriptions, these will be used by implementations for generating default request handlers. Then ExposedThings can be just created based on a TD and then just call When an app script defines or overloads an The possible requests are defined by the TD, and will certainly fall in the following categories:
Now on why do we have the current API design with
You are right that However, I exposed it for the sake of clarity (and symmetry with You would be also right (and there is a Note about it) that on I expect we clarify these when we discuss event modeling on the F2F. My choice would be using In summary, indeed we need to consolidate the API in this regard. |
I fear that this is currently headed toward a solution that exposes all the nitty gritty details to the script, so that we do not gain anything from the Thing abstraction; we basically script some kind of mutated REST framework. Also the parts such as The original idea was to focus on the pure application logic following a reactive programming paradigm: The script tells the runtime it should manage a Property of a certain type and the script gets notified when it's being changed or read, although in many cases the script does not care about reading and the runtime can answer directly without context-switch. If someone wants to have access to every last system and implementation detail, they can work on the inside of a Servient implementation. It would be great if we can continue with a minimalist, logic-focused API and collect the implementation aspects and internal APIs outside the API specification? After a full iteration, we can check which aspects should be exposed to the script and start a new iteration. |
Thank you for the comments.
It is standard property management.
They do different things. register() will publish the TD, start() will start serving requests. In a servient implementation these are legitimate steps if the app wants to control when to serve requests.
There is no way out of specifying request handlers on an ExposedThing. If you have API suggestions for that, please make them. |
To me it seems that removing type from Request should be possible, because the implementation can dispatch the right Request object to the right handler. However, since it is the implementation that can create Request objects, Even if remove the We can also pursue an alternative API design for ExposedThing handlers, please make suggestions (whole WebIDL for ExposedThing functionality). |
What is the benefit of having this? It is not protecting anything, since the script that might want call remove is the same that can simple change a false to true. For enumerable, I don't understand the purpose? Making it hidden in the TD? I am going over more details by writing the Current Practices for the Burlingame Current Practices. In that course, I will aim to make for API proposals. |
First of all, property descriptors have been there in the API. I wonder why it is now that this is suddenly challenged. With
I guess I surmise there might be a difference in how TD vs scripts are understood.
Welcome to propose APIs, only one point: let's try to avoid mixing TD fragments and code in designing a solution. if we have to keep TD fragments around, it proves we cannot do a proper scripting API - or that we don't need it. |
You are mixing the concepts of JavaScript objects with the concepts of WoT Interactions. The |
The TD spec is obviously missing out on property management. |
Let's come back to the original issue. I opened new issues for the new topics started here.
WoT.Request turned out to be part of a low-level CRUDN API. For this, I would say it would need the type attribute. Yet then ExposedThing would also only need a single Furthermore, the WoT Scripting API should remain a simple API on top of the Thing abstraction. Let's not overengineer it to a generic CRUDN IoT framework and keep it simple and the Scripting API slim with only what the application logic needs. Logging, accounting, analytics, etc. are left the Servient implementation. Please feel encouraged to document your requirements, possibly in a, for instance, WoT Servient API document for later exploitation. |
Yes, that would be logical.
Actually with If we want to revert to a more verbose API and client code, we can discuss that in the next call. |
What verbose client code? This is about WoT Servers / ExposedThings. When the script has to do its own Request analysis and multiplexing, the code becomes more verbose. Your assumption sounds a bit like "we simplified the API a lot for people already programming IoTivity" (or any other generic framework on the request/reponse level for that matter) and it falls under the critique by Mozilla and others: why standardize this at all? There is no point in standardizing a generic IoT framework. |
Yet in fact that's what we are doing in WoT. Just by implementing "generic" in our "TD" way. |
Obsoleted by #86. |
The WoT.Request besides other information provides an attribute
type
which is defined asI wonder why we actually need this information. A request of type
Hence no need to have this additional information. Moreover, It even complicates the situation because we need to define what happens if onInvokeAction() receives a request of type "property" ... (failure?)
The text was updated successfully, but these errors were encountered: