First stab at System Info & Events API

Hello all,

Following Robin's advice to put some concrete APIs on paper, so I gave it a stab: 

http://dev.w3.org/2009/dap/system-info/Overview.html


Also some thinking around about extensibility and how implement for known capabilities versus unknown future capabilities.

A) use concrete APIs for well known existing capabilities
B) have a 'sequence' of objects defined that have extension capabilities. This allows future apps to find them and make use of them *between&* major revisions of the specification. These extensions can be brought into the specification at major revisions and they will then become concrete APIs.

Example interfaces:
interface CapabilityExtensions : Object {
    readonly attribute sequence DAPExtension Cap;
};

interface EventExtenstions : Object {
    readonly attribute sequence DAPExtension events;
};


interface DAPExtension: Object {
    readonly attribute DOMString name;
    readonly attribute DOMString vendor;
    readonly attribute DOMString version;
    attribute Object extOb;
};

Javascript to find / use an extension capability:
var futureExt;
for(var x = 0; x < device.capabilityExtensions.length; x++){
  currExt = device.capabilityExtensions[x];
  if(currExt.name == "cool new capability"){
    futureExt = device.capabilityExtensions[x];
  }
}
if(futureExt === undefined){
  /* extention not available */
}
else{
  /* use it based on vendor specification*/
  futureExt.XYZApi()
}

Received on Wednesday, 21 October 2009 03:25:24 UTC