Skip to content

Add use cases #6

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

Closed
knimura opened this issue Mar 5, 2017 · 13 comments
Closed

Add use cases #6

knimura opened this issue Mar 5, 2017 · 13 comments
Labels
enhancement Thoughts and ideas about possible improvements

Comments

@knimura
Copy link
Contributor

knimura commented Mar 5, 2017

Wouldn't it be necessary to have the following use cases?

[ConsumedThing]

  • Currently only mentions consume remote thing.
    use case for local string/object?
  • Use case for remove all listeners.

[ExposedThing]

  • Use case for remove all listeners.
  • Use case for unregister a thing.
  • Use case for start.

[Programmable]

  • use case for add a handler which is called when an action is invoked.
    this is different from use case for addAction which only defines name and parameter/return type for action.
  • use case for clear ActionHander
  • use case for add a handler which is called when a property value is updated
  • use case for multiple add PropertyChangeListeners
  • use case for remove a handler which is called when a property is updated
  • use case for remove all handlers which are called when a property is updated
@zolkis
Copy link
Contributor

zolkis commented Mar 6, 2017

For ExposedThing:

  • start and stop is already there in the use cases.
  • register and unregister seems to be missing, we need to add.
  • removing all listeners means removing other clients from observing a Thing. This is very invasive and until we have a solid security model, IMHO should not be encouraged. What is the application use case for this scripting use case?

For ConsumedThing:

  • IMHO it should make no difference in the API if the consumed Thing is local or remote; it is identified by a URI. It's the bindings/implementation that should care about local optimization, IMHO we should not create a local and remote API for consumed and exposed things. Arguably, if there is reason for local APIs, they should go in a different spec, and appeal to WoT bindings/implementations.

Other

  • what is the application use case for action hooks? observing/deflecting by other clients when an action is triggered by some other client? So every client can register an action hook? If so, IMHO we need to think it over find a better abstraction for this (and the pattern in general, not only including actions).
    If this is for the local script, IMHO hooks are not needed, since it can be done locally in script.
    So, code examples would be helpful in order to clarify what do we want to achieve here.

@zolkis
Copy link
Contributor

zolkis commented Mar 6, 2017

Should we add flags to an ExposedThing whether they are meant to be discoverable, observable, etc? (policies)

@zolkis
Copy link
Contributor

zolkis commented Mar 10, 2017

As mentioned here I still don't see the value of server side hooks on property changes and action invocations.

Observing property changes and action invocations should be part of the client API.
On the server, since the hooks would be defined by the same script that defines the server Thing, that logic could go directly in the request handlers.

Could someone provide code examples for why server side hooks are needed?

IMHO the use case is already covered by the client use case
"Add a listener to an event."
Property change and invocation of action could be default events defined on the server.

zolkis added a commit to zolkis/wot-scripting-api that referenced this issue Mar 10, 2017
zolkis added a commit to zolkis/wot-scripting-api that referenced this issue Mar 10, 2017
zolkis added a commit to zolkis/wot-scripting-api that referenced this issue Mar 10, 2017
zolkis added a commit to zolkis/wot-scripting-api that referenced this issue Mar 10, 2017
@knimura
Copy link
Contributor Author

knimura commented Mar 13, 2017

Latest use cases seem fine.
Lifecycle of script could be added if we agreed on.

@h0ru5
Copy link
Contributor

h0ru5 commented Mar 25, 2017

I have one little detail:
For exposing things, I'd like to group/seperate the cases to add/remove properties/actions etc. from the cases to attach listeners, change properties etc.

rationale:
on consrtrained runtimes or when constructing a thing from a TD, it might be the case that you can add handlers and interact with an exposed thing, but not add/remove properties/actions etc.
That concept was discussed only a bit so far, as we tried to separate ExposedThing (exposed and not modifiable in structure) and DynamicThing (exposed and modifable)

@zolkis
Copy link
Contributor

zolkis commented Mar 26, 2017

Yes, this might also be a good thing from security point of view: Things might want to define different policies to these types of access.

@knimura
Copy link
Contributor Author

knimura commented Mar 26, 2017

"Issue #2"

the runtime hosts one ore several things and runs scripts.
Things in a runtime share these
In this case, "DynamicThing" could consolidate these ?

@knimura
Copy link
Contributor Author

knimura commented Mar 26, 2017

In the above case, "DynamicThing" could consolidates these ?

@h0ru5
Copy link
Contributor

h0ru5 commented Mar 27, 2017

Taking discussion on "DynamicThing" vs. "ExposedThing" to an own issue

@h0ru5
Copy link
Contributor

h0ru5 commented Mar 27, 2017

we're leaving this issue open for further discussion on potenitially missing use cases

@zolkis zolkis added enhancement Thoughts and ideas about possible improvements help wanted labels Apr 7, 2017
@knimura
Copy link
Contributor Author

knimura commented Aug 22, 2017

| On a consumed Thing
| Observe events
| Default events are the following:
| A property has changed.
| An action has been invoked.

Above default events might be noisy in some cases and would need to have verbose off function.
Then those can be removed and simply declare by "add listener to an event" if needed.

@danielpeintner
Copy link
Contributor

I checked https://w3c.github.io/wot-scripting-api/#use-cases and it looks like all use-cases are in place. Any objections to close this issue?

@zolkis
Copy link
Contributor

zolkis commented Feb 14, 2018

Addressed by #86.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Thoughts and ideas about possible improvements
Projects
None yet
Development

No branches or pull requests

4 participants