Re: Devices as Virtual Web Services

Hi Mark,

On 27/01/2010 17:36, Mark Baker wrote:
> Granted, it's not suitable for everything, but it seems to me that
> there's some low hanging fruit such as the System Info API that could
> be easily done via the DOM.

That's exactly what W3C's DCCI does [1]: a DOM of system-properties. 
Yet, I don't think that that specification was ever implemented, let 
alone used, probably because the concept of a DOM of properties is too 
obscure for your basic system-property query (battery level, CPU load, 
etc.). You don't want to start exploring a hierarchy, let alone use DOM 
functions, you just want a function.

IMO the SysInfo API is a framework, an abstraction on top of either a 
DCCI or a REST implementation. Even more abstract than JQuery, if you like:


    SysInfo
      |
    JQuery
   /     \
DCCI    REST

You can either you write your Battery Monitor using bare-bones DCCI (see 
[1] appendix B to get an idea) or XHR, or you make it simpler for 
yourself with JQuery:

$.dcci("device battery", callback) if based on DCCI
$.get("device://battery", callback) if based on REST

or top-level-abstract-framework-agnostic:

navigator.sysinfo.get("Battery", callback)

[1] http://www.w3.org/TR/DPF/

Max.

Received on Thursday, 28 January 2010 15:56:51 UTC