{"action":"created","issue":{"url":"https://api.github.com/repos/w3c/automotive/issues/37","labels_url":"https://api.github.com/repos/w3c/automotive/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/w3c/automotive/issues/37/comments","events_url":"https://api.github.com/repos/w3c/automotive/issues/37/events","html_url":"https://github.com/w3c/automotive/issues/37","id":83672291,"number":37,"title":"Refactor API signatures","user":{"login":"djensen47","id":527865,"avatar_url":"https://avatars.githubusercontent.com/u/527865?v=3","gravatar_id":"","url":"https://api.github.com/users/djensen47","html_url":"https://github.com/djensen47","followers_url":"https://api.github.com/users/djensen47/followers","following_url":"https://api.github.com/users/djensen47/following{/other_user}","gists_url":"https://api.github.com/users/djensen47/gists{/gist_id}","starred_url":"https://api.github.com/users/djensen47/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djensen47/subscriptions","organizations_url":"https://api.github.com/users/djensen47/orgs","repos_url":"https://api.github.com/users/djensen47/repos","events_url":"https://api.github.com/users/djensen47/events{/privacy}","received_events_url":"https://api.github.com/users/djensen47/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":39,"created_at":"2015-06-01T20:10:52Z","updated_at":"2015-08-04T17:32:32Z","closed_at":null,"body":"Currently the API works on this signature pattern:\r\n\r\n`vehicle.dataPoint.method`\r\n\r\nBut `dataPoint` is, in a sense, just data, i.e, meta-data, itself.\r\n\r\nSince we are dealing with many dozen data points some of which may or may not be implemented, something the following this seems cleaner.\r\n\r\n`vehicle.method(dataPoint, params…)`\r\n\r\nNow it doesn't appear as if there are dozens or hundreds of APIs, now we have 3 or 4. It also leaves some flexibility to the implementation. Maybe, it's not a 1-to-1 mapping to the clib implementation but I don't think it should be. This is JavaScript/ECMAScript not C.\r\n\r\n- `vehicle.get(data, options)`\r\n- `vehicle.set(data, value, options)`\r\n- `vehicle.subscribe(data, options, callback)`\r\n- `vehicle.unsubscribe(data, handler)`\r\n- `vehicle.availableFor...(data)`\r\n\r\n`data` is simply a String, the name of the data point like `'vehicleSpeed'` \r\n`options` include information like zone, event period\r\n\r\nThis also avoids the issue where `vehicle.vehicleSpeed.get()` could result in a `Cannot call method 'get' of undefined` if vehicleSpeed is not implemented.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/w3c/automotive/issues/comments/127686316","html_url":"https://github.com/w3c/automotive/issues/37#issuecomment-127686316","issue_url":"https://api.github.com/repos/w3c/automotive/issues/37","id":127686316,"user":{"login":"aShinjiroUrata","id":2240108,"avatar_url":"https://avatars.githubusercontent.com/u/2240108?v=3","gravatar_id":"","url":"https://api.github.com/users/aShinjiroUrata","html_url":"https://github.com/aShinjiroUrata","followers_url":"https://api.github.com/users/aShinjiroUrata/followers","following_url":"https://api.github.com/users/aShinjiroUrata/following{/other_user}","gists_url":"https://api.github.com/users/aShinjiroUrata/gists{/gist_id}","starred_url":"https://api.github.com/users/aShinjiroUrata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aShinjiroUrata/subscriptions","organizations_url":"https://api.github.com/users/aShinjiroUrata/orgs","repos_url":"https://api.github.com/users/aShinjiroUrata/repos","events_url":"https://api.github.com/users/aShinjiroUrata/events{/privacy}","received_events_url":"https://api.github.com/users/aShinjiroUrata/received_events","type":"User","site_admin":false},"created_at":"2015-08-04T17:32:32Z","updated_at":"2015-08-04T17:32:32Z","body":">it would be great if we could have feedbacks from the experts in outside at early stage of the specs. :)\r\nI agree.\r\n"}}