Re: IOTDB: modeling state

You always need to know when a property value has taken effect if you're
presenting a user interface. e.g. an interface can't tell a user that the
light has turned off when they can clearly see that it's still on! Instead
the interface has to indicate that the system is in a transitioning state.

IOTDB has an incredible simple model: you manipulate JSON dictionaries,
either to get values or to change the state of things. When dictionaries
change value, callbacks are invoked to tell you "hey, such and such has
changed". This maps incredibly well into REST + MQTT (for notifications).
>From a developer POV, it is stateless just like we expect a server to be.

If my server stops and restarts, I don't need to know that "hey I was doing
some action, I wonder what happened". Again, this maps very much to the way
that developers think about REST and servers.

If I have a web interface, I do not need to keep around the concept that
"I'm running an action". I know I'm - or someone else! - is running an
action because the ostate reflects that while it's happening.

D.


On Tue, Jun 2, 2015 at 2:10 PM, Dave Raggett <dsr@w3.org> wrote:

>
> On 2 Jun 2015, at 18:44, David Janes <davidjanes@davidjanes.com> wrote:
>
> These distinctions become much more obvious when you work with real
> devices. We, as programmers are using to things happening immediately - we
> update a database, and the value is what we updated it to.
>
> This isn't true for Things.
>
>
> This is why developers need to assume an asynchronous approach.  In a
> distributed system this is essential. Could you please provide a use case
> where you need to know when a property update has taken effect?  Perhaps
> this could be better modelled using an action with a result? That would
> enable a script to determine when the action had been completed.
>
> p.s. in the Web of Things Framework actions may provide asynchronous
> results.
>
> —
>    Dave Raggett <dsr@w3.org>
>
>
>
>

Received on Tuesday, 2 June 2015 18:28:11 UTC