|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
[Fwd: W3C and APIs -- request for agenda item]-------- Original Message -------- Subject: W3C and APIs -- request for agenda item Date: Sun, 14 Jun 2009 06:23:09 -0700 From: ashok malhotra <ashok.malhotra@...> Reply-To: ashok.malhotra@... Organization: Oracle To: tag@... <tag@...> The attached writeup is from Larry, John and me. -- All the best, Ashok -- All the best, Ashok W3C and APIsHistorically, the W3C has focused primarily on developing clearly declarative languages (such as HTML, and the XML-based languages) and syntactic elements used in protocols. The AWWW [1] says “The Web follows Internet tradition in that its important interfaces are defined in terms of protocols, by specifying the syntax, semantics, and sequencing constraints of the messages interchanged.” But over time, use of scripting languages (and Javascript in particular) and event-based APIs (such as DOM) has increased; today’s HTML specification focuses more on the DOM2 HTML API than it does on the declarative syntax of HTML itself, for example. Recently, the W3C has greatly increased its focus on defining APIs [2,3]. This raises the question of whether the W3C TAG should offer further guidance to the developers of APIs, and whether (or how) that guidance should differ from that offered to the developer of a declarative language or protocol. APIs are often described by means of an interface definition language (such as WebIDL[6]) adding yet another language to the heady mix available on the Web today. At this point a sceptic might say the W3C offers little guidance to the developers of declarative languages and protocols -- why need we do something different for API developers? But this is not quite true. We do offer some guidance and best practices to developers of declarative languages and protocols: use namespaces for extensibility, use http namespaces, plan for extensibility and versioning, etc. So here are some suggested changes:
References[1] http://www.w3.org/TR/webarch/#protocol-interop [2] http://www.w3.org/2009/05/DeviceAPICharter [3] http://www.w3.org/2008/geolocation/drafts/API/ [4] http://www.w3.org/2005/10/Process-20051014/tr#rec-advance |
|
|
Re: [Fwd: W3C and APIs -- request for agenda item]Thank you. The F2F agenda has been updated to point to the public copies.
Noah -------------------------------------- Noah Mendelsohn IBM Corporation One Rogers Street Cambridge, MA 02142 1-617-693-4036 -------------------------------------- ashok malhotra <ashok.malhotra@...> Sent by: www-tag-request@... 06/18/2009 03:12 PM Please respond to ashok.malhotra To: "www-tag@..." <www-tag@...> cc: (bcc: Noah Mendelsohn/Cambridge/IBM) Subject: [Fwd: W3C and APIs -- request for agenda item] Forwarding to www-tag -------- Original Message -------- Subject: W3C and APIs -- request for agenda item Date: Sun, 14 Jun 2009 06:23:09 -0700 From: ashok malhotra <ashok.malhotra@...> Reply-To: ashok.malhotra@... Organization: Oracle To: tag@... <tag@...> The attached writeup is from Larry, John and me. -- All the best, Ashok -- All the best, Ashok W3C and APIs Historically, the W3C has focused primarily on developing clearly declarative languages (such as HTML, and the XML-based languages) and syntactic elements used in protocols. The AWWW [1] says “The Web follows Internet tradition in that its important interfaces are defined in terms of protocols, by specifying the syntax, semantics, and sequencing constraints of the messages interchanged.” But over time, use of scripting languages (and Javascript in particular) and event-based APIs (such as DOM) has increased; today’s HTML specification focuses more on the DOM2 HTML API than it does on the declarative syntax of HTML itself, for example. Recently, the W3C has greatly increased its focus on defining APIs [2,3]. This raises the question of whether the W3C TAG should offer further guidance to the developers of APIs, and whether (or how) that guidance should differ from that offered to the developer of a declarative language or protocol. APIs are often described by means of an interface definition language (such as WebIDL[6]) adding yet another language to the heady mix available on the Web today. At this point a sceptic might say the W3C offers little guidance to the developers of declarative languages and protocols -- why need we do something different for API developers? But this is not quite true. We do offer some guidance and best practices to developers of declarative languages and protocols: use namespaces for extensibility, use http namespaces, plan for extensibility and versioning, etc. So here are some suggested changes: 1. Revise the AWWW [1] to discuss the role of APIs and active content in general. 2. The process document [4] says “ … , the Working Group SHOULD be able to demonstrate two interoperable implementations of each feature.” Clarify what this means for APIs insofar as APIs are often embedded in, or used in context with, other languages. 3. Think through what we want to say about versioning and extensibility. It may be even more important for extended versions of APIs to work with old devices than for HTML to work with old browsers. 4. The failure model may be different. If the implementation does not understand a statement, what does it do: error, crash and burn, ignore? In typical interface definition languages, this is handled by describing exception cases which are documented for a particular interface. 5. Subverting the traditional client-server model of the Web (by allowing a client to effectively serve Web content via an API call) has implications (particularly in the areas of security and privacy) for the relationship between a client and a server. The Geolocation API [3] and the Device APIs Charter [2] both mention security and privacy policies but, as yet there are large disagreements on what shape such policies should take. This seems an important, fundamental area for future work. (One problem with policy is that in a web of autonomous, often anonymous agents, who will enforce policy and where will it be enforced? For example, is it sufficient for GPS devices just have a switch to turn off location broadcasting?) 6. There may be a need for guidance on how an API should be embedded in other Web content. For example, in Geolocation the host language identifies the device while the API specifies operations on the device. Similarly, if there is an error during the processing of an API request, how is that reported to the host content? 7. Testing APIs is different from testing protocols at least, in part due to wide variability in features between implementations of the API. For example, the Mobile Test Initiative has made a good start by publishing a note on how to write device-independent tests for mobile devices [5]. References [1] http://www.w3.org/TR/webarch/#protocol-interop [2] http://www.w3.org/2009/05/DeviceAPICharter [3] http://www.w3.org/2008/geolocation/drafts/API/ [4] http://www.w3.org/2005/10/Process-20051014/tr#rec-advance [5] http://www.w3.org/TR/2009/NOTE-di-testing-20090512/ [6] http://dev.w3.org/2006/webapi/WebIDL/ |
|
|
Re: [Fwd: W3C and APIs -- request for agenda item]> The attached writeup is from Larry, John and me.
In reading it at the URI it's now at: http://lists.w3.org/Archives/Public/www-tag/2009Jun/att-0085/W3C_and_APIs.htm ...I note that there -- where it's now publicly accessible and standing alone outside the original context of this e-mail discussion -- there is no way to tell who authored it, because there's not attribution within the document itself. It might be helpful to add that and either re-send it to the list so it gets a different URL, or alternatively just post it at some stable URL. It would also be helpful if the document had a <title> element. --Mike > W3C and APIs > > Historically, the W3C has focused primarily on developing clearly > declarative languages (such as HTML, and the XML-based languages) and > syntactic elements used in protocols. The AWWW [1] says “The Web follows > Internet tradition in that its important interfaces are defined in terms > of protocols, by specifying the syntax, semantics, and sequencing > constraints of the messages interchanged.” > > But over time, use of scripting languages (and Javascript in particular) > and event-based APIs (such as DOM) has increased; today’s HTML > specification focuses more on the DOM2 HTML API than it does on the > declarative syntax of HTML itself, for example. > > Recently, the W3C has greatly increased its focus on defining APIs [2,3]. > This raises the question of whether the W3C TAG should offer further > guidance to the developers of APIs, and whether (or how) that guidance > should differ from that offered to the developer of a declarative language > or protocol. > > APIs are often described by means of an interface definition language > (such as WebIDL[6]) adding yet another language to the heady mix available > on the Web today. > > At this point a sceptic might say the W3C offers little guidance to the > developers of declarative languages and protocols -- why need we do > something different for API developers? But this is not quite true. We do > offer some guidance and best practices to developers of declarative > languages and protocols: use namespaces for extensibility, use http > namespaces, plan for extensibility and versioning, etc. So here are some > suggested changes: > > 1. Revise the AWWW [1] to discuss the role of APIs and active content in > general. > > 2. The process document [4] says “ … , the Working Group SHOULD be able > to demonstrate two interoperable implementations of each feature.” > Clarify what this means for APIs insofar as APIs are often embedded > in, or used in context with, other languages. > > 3. Think through what we want to say about versioning and extensibility. > It may be even more important for extended versions of APIs to work > with old devices than for HTML to work with old browsers. > > 4. The failure model may be different. If the implementation does not > understand a statement, what does it do: error, crash and burn, > ignore? In typical interface definition languages, this is handled by > describing exception cases which are documented for a particular > interface. > > 5. Subverting the traditional client-server model of the Web (by allowing > a client to effectively serve Web content via an API call) has > implications (particularly in the areas of security and privacy) for > the relationship between a client and a server. > > The Geolocation API [3] and the Device APIs Charter [2] both mention > security and privacy policies but, as yet there are large > disagreements on what shape such policies should take. This seems an > important, fundamental area for future work. (One problem with policy > is that in a web of autonomous, often anonymous agents, who will > enforce policy and where will it be enforced? For example, is it > sufficient for GPS devices just have a switch to turn off location > broadcasting?) > > 6. There may be a need for guidance on how an API should be embedded in > other Web content. > > For example, in Geolocation the host language identifies the device > while the API specifies operations on the device. Similarly, if there > is an error during the processing of an API request, how is that > reported to the host content? > > 7. Testing APIs is different from testing protocols at least, in part due > to wide variability in features between implementations of the API. > For example, the Mobile Test Initiative has made a good start by > publishing a note on how to write device-independent tests for mobile > devices [5]. > > References > > [1] [1]http://www.w3.org/TR/webarch/#protocol-interop > > [2] [2]http://www.w3.org/2009/05/DeviceAPICharter > > [3] [3]http://www.w3.org/2008/geolocation/drafts/API/ > > [4] [4]http://www.w3.org/2005/10/Process-20051014/tr#rec-advance > > [5] [5]http://www.w3.org/TR/2009/NOTE-di-testing-20090512/ > > [6] [6]http://dev.w3.org/2006/webapi/WebIDL/ > > References > > Visible links > 1. http://www.w3.org/TR/webarch/#protocol-interop > 2. http://www.w3.org/2009/05/DeviceAPICharter > 3. http://www.w3.org/2008/geolocation/drafts/API/ > 4. http://www.w3.org/2005/10/Process-20051014/tr#rec-advance > 5. http://www.w3.org/TR/2009/NOTE-di-testing-20090512/ > 6. http://dev.w3.org/2006/webapi/WebIDL/ -- Michael(tm) Smith http://people.w3.org/mike/ |
|
|
Re: [Fwd: W3C and APIs -- request for agenda item]Hi,
a few notes on the topic of APIs. On Jun 18, 2009, at 21:12 , ashok malhotra wrote: > Recently, the W3C has greatly increased its focus on defining APIs > [2,3]. > I am unconvinced that the increase is as strong as it is made out to be. W3C has produced a fair number of APIs over the years: just the sum total of all the DOM specifications, plus the HTML DOM, SVG DOM, and CSS OM already add up to a lot of interfaces. The initial WebAPI WG (now WebApps) was chartered a few years back with already a large set of APIs in its remit. Before that, the SVG WG had been working on a number of non-DOM APIs as well. And then there's Geolocation, DCI (fka DPF) and a few others I'm probably forgetting about. I think that the shift, if shift there is, has more to do with what we are defining APIs to. The early ones were more internally oriented, whereas the upcoming ones are turned more towards the outside world. I'm unsure that this is an issue though, rather than simply a manifestation of the fact that the web is extending its rosy fingers well outside of the browser. > This raises the question of whether the W3C TAG should offer further > guidance to the developers of APIs, and whether (or how) that > guidance should differ from that offered to the developer of a > declarative language or protocol. > I would add: and whether it should differ from guidance offered to APIs previously defined within W3C. > APIs are often described by means of an interface definition > language (such as WebIDL[6]) adding yet another language to the > heady mix available on the Web today. > I am unsure what to make of this comment. WebIDL fills a very useful gap: it provides formalism and an interoperable translation to Javascript interfaces for the APIs that we can define. Early W3C APIs were defined using OMG IDL, but it eventually turned out to be a poor match for the type of interfaces often desired. This lead to a number of W3C specifications being released that used something that looked like IDL, but wasn't valid according to any definition, and did not have binding translations to Javascript. The OMTP BONDI Interfaces group also experimented with using Java interfaces for this purpose, but they too were found lacking in several respects which together with Java's quasi-irrelevance in a web content context caused that approach to be abandoned in favour of WebIDL. Work on WebIDL is painstaking and understaffed — if we had had a better option available I'm pretty sure that everyone would have been happy to reuse it. I'm sure the WebApps WG would therefore welcome pointers to viable alternatives within that "heady mix available on the Web today" of which you speak. > • Revise the AWWW [1] to discuss the role of APIs and active content > in general. That would certainly be worthwhile. OMTP BONDI and WebApps have both had heated arguments about versioning, to the point where asking which version of the versioning argument we're on now has become a trite joke. And I expect that ugly baby to come back in DAP. A balanced take on how APIs and markup complement one another could also prove helpful — that debate has been making rounds for too long and should be put to sleep. > • The process document [4] says “ … , the Working Group SHOULD be > able to demonstrate two interoperable implementations of each > feature.” Clarify what this means for APIs insofar as APIs are often > embedded in, or used in context with, other languages. I am not convinced that this is a useful topic to clarify. A WG typically has a fairly good idea of its community and industry (otherwise, it has issues more serious than its CR exit criteria). If it finds that it needs its test suite to operate in a single language or in twenty, it's probably right (and probably won't listen to the TAG telling it otherwise). > •Think through what we want to say about versioning and > extensibility. It may be even more important for extended versions > of APIs to work with old devices than for HTML to work with old > browsers. It's just as important, and the same fundamental rules apply. > • The failure model may be different. If the implementation does not > understand a statement, what does it do: error, crash and burn, > ignore? In typical interface definition languages, this is handled > by describing exception cases which are documented for a particular > interface. This should be up to the concrete implementation language, not the IDL. At some point the extensibility model has to hit the road, and you can't usefully enforce support for a feature across languages. It was tried with DOM's hasFeature(), which in practice produces completely untrustable results. > • Subverting the traditional client-server model of the Web (by > allowing a client to effectively serve Web content via an API call) > has implications (particularly in the areas of security and privacy) > for the relationship between a client and a server. I'm not sure that this is ever really happening. The client can write to services — but that's always been part of the web (even if often insufficiently so). If you're thinking about things like Opera Unite I don't believe it changes anything: it's a client and it's a server, and there's a nice UI to the latter in the former, but that's about it. No architectural change. > The Geolocation API [3] and the Device APIs Charter [2] both mention > security and privacy policies but, as yet there are large > disagreements on what shape such policies should take. > That's precisely the "Policy" part of DAP. > • There may be a need for guidance on how an API should be embedded > in other Web content. For example, in Geolocation the host language > identifies the device while the API specifies operations on the > device. Similarly, if there is an error during the processing of an > API request, how is that reported to the host content? > Could you please clarify what you meant here? I'm not sure how we need to change existing models here. > • Testing APIs is different from testing protocols at least, in part > due to wide variability in features between implementations of the > API. For example, the Mobile Test Initiative has made a good start > by publishing a note on how to write device-independent tests for > mobile devices [5]. I think the largest chunk that needs to be clear here is capability- based testing, i.e. how can I conform to the Camera API if I'm a user- agent running on a device that doesn't have a camera? -- Robin Berjon - http://berjon.com/ Feel like hiring me? Go to http://robineko.com/ |
|
|
Re: [Fwd: W3C and APIs -- request for agenda item]Hello Robin,
Thank you for your insightful comments - my questions and comments inline below: ext Robin Berjon wrote: > Hi, > > a few notes on the topic of APIs. > > On Jun 18, 2009, at 21:12 , ashok malhotra wrote: >> Recently, the W3C has greatly increased its focus on defining APIs >> [2,3]. >> > > I am unconvinced that the increase is as strong as it is made out to > be. W3C has produced a fair number of APIs over the years: just the > sum total of all the DOM specifications, plus the HTML DOM, SVG DOM, > and CSS OM already add up to a lot of interfaces. The initial WebAPI > WG (now WebApps) was chartered a few years back with already a large > set of APIs in its remit. Before that, the SVG WG had been working on > a number of non-DOM APIs as well. And then there's Geolocation, DCI > (fka DPF) and a few others I'm probably forgetting about. If you were to look at AWWW, however, would it give you a sense that it related to any of those efforts? Or would it give you the sense that since AWWW was created, W3C has "suddenly" begun working on APIs? > > I think that the shift, if shift there is, has more to do with what we > are defining APIs to. The early ones were more internally oriented, > whereas the upcoming ones are turned more towards the outside world. > I'm unsure that this is an issue though, rather than simply a > manifestation of the fact that the web is extending its rosy fingers > well outside of the browser. > >> This raises the question of whether the W3C TAG should offer further >> guidance to the developers of APIs, and whether (or how) that >> guidance should differ from that offered to the developer of a >> declarative language or protocol. >> > > I would add: and whether it should differ from guidance offered to > APIs previously defined within W3C. Can you provide any pointers to the guidance offered to APIs previously defined within W3C? [...] > > Work on WebIDL is painstaking and understaffed — if we had had a > better option available I'm pretty sure that everyone would have been > happy to reuse it. I'm sure the WebApps WG would therefore welcome > pointers to viable alternatives within that "heady mix available on > the Web today" of which you speak. I wasn't suggesting that there are any good alternatives to WebIDL, merely that we are creating an interface-definition language to complement the other languages available on the Web. > >> • Revise the AWWW [1] to discuss the role of APIs and active content >> in general. > > That would certainly be worthwhile. OMTP BONDI and WebApps have both > had heated arguments about versioning, to the point where asking which > version of the versioning argument we're on now has become a trite > joke. That's good to know - if you could provide some kind of pointer to any of these discussions, that would be most helpful. [...] >> • The failure model may be different. If the implementation does not >> understand a statement, what does it do: error, crash and burn, >> ignore? In typical interface definition languages, this is handled >> by describing exception cases which are documented for a particular >> interface. > > This should be up to the concrete implementation language, not the > IDL. WebIDL allows the definition of exception conditions (http://www.w3.org/TR/WebIDL/#idl-exceptions). But what should happen if some Javascript is contained within a compound document, and an exception condition occurs? I do think we should be carefully drawing the distinction between the interface definition language, the API implementation code, and code which uses the API. > At some point the extensibility model has to hit the road, and > you can't usefully enforce support for a feature across languages. It > was tried with DOM's hasFeature(), which in practice produces > completely untrustable results. > > >> • Subverting the traditional client-server model of the Web (by >> allowing a client to effectively serve Web content via an API call) >> has implications (particularly in the areas of security and privacy) >> for the relationship between a client and a server. > > I'm not sure that this is ever really happening. The client can write > to services — but that's always been part of the web (even if often > insufficiently so). If you're thinking about things like Opera Unite I > don't believe it changes anything: it's a client and it's a server, > and there's a nice UI to the latter in the former, but that's about > it. No architectural change. I think there are (at least) privacy concerns when running a server that is "in my pocket". For example, if you consistently give out the same IP address, or other identifiers to some group of clients, those clients (which can play the role of servers too) can correlate that identifier and use it as an identifier closely related to a natural person. If, however, you give out IP addresses which frequently change, in order to protect privacy, you have the condition that a proxy server is needed in order to contact the server-client, if that server-client desires to be readily available to the outside world. I don't see that as an architectural change, but I do think it raises the emphasis on security and privacy related to the architecture. I would also note that in the "traditional" Web model, servers usually expose resources, named with URIs. If, however, we expose resources as Javascript function calls (for example), what are the URIs which name these resources? What are the AWWW representations "returned"? [...] Regards, - johnk |
|
|
Re: [Fwd: W3C and APIs -- request for agenda item]It occurs to me that one of the most significant "API" interfaces that the
W3C is contemplating for a Recommendation is the 2D Graphics [1] context of the proposed HTML 5 Canvas tag [2]. I see no reason why the W3C should not be in the business of specifying such APIs in situations where they seem to be the technically appropriate means of, in this case, encoding a Web representation. As an aside, The Rule of Least Power [3] suggests that more declarative approaches might be attractive if they prove practical, but that certainly doesn't in any way discourage W3C from being involved in situations where this more imperative style of interface is indeed the best. Noah [1] http://dev.w3.org/html5/spec/Overview.html#the-2d-context [2] http://dev.w3.org/html5/spec/Overview.html#the-canvas-element [3] http://www.w3.org/2001/tag/doc/leastPower.html -------------------------------------- Noah Mendelsohn IBM Corporation One Rogers Street Cambridge, MA 02142 1-617-693-4036 -------------------------------------- ashok malhotra <ashok.malhotra@...> Sent by: www-tag-request@... 06/18/2009 03:12 PM Please respond to ashok.malhotra To: "www-tag@..." <www-tag@...> cc: (bcc: Noah Mendelsohn/Cambridge/IBM) Subject: [Fwd: W3C and APIs -- request for agenda item] Forwarding to www-tag -------- Original Message -------- Subject: W3C and APIs -- request for agenda item Date: Sun, 14 Jun 2009 06:23:09 -0700 From: ashok malhotra <ashok.malhotra@...> Reply-To: ashok.malhotra@... Organization: Oracle To: tag@... <tag@...> The attached writeup is from Larry, John and me. -- All the best, Ashok -- All the best, Ashok W3C and APIs Historically, the W3C has focused primarily on developing clearly declarative languages (such as HTML, and the XML-based languages) and syntactic elements used in protocols. The AWWW [1] says “The Web follows Internet tradition in that its important interfaces are defined in terms of protocols, by specifying the syntax, semantics, and sequencing constraints of the messages interchanged.” But over time, use of scripting languages (and Javascript in particular) and event-based APIs (such as DOM) has increased; today’s HTML specification focuses more on the DOM2 HTML API than it does on the declarative syntax of HTML itself, for example. Recently, the W3C has greatly increased its focus on defining APIs [2,3]. This raises the question of whether the W3C TAG should offer further guidance to the developers of APIs, and whether (or how) that guidance should differ from that offered to the developer of a declarative language or protocol. APIs are often described by means of an interface definition language (such as WebIDL[6]) adding yet another language to the heady mix available on the Web today. At this point a sceptic might say the W3C offers little guidance to the developers of declarative languages and protocols -- why need we do something different for API developers? But this is not quite true. We do offer some guidance and best practices to developers of declarative languages and protocols: use namespaces for extensibility, use http namespaces, plan for extensibility and versioning, etc. So here are some suggested changes: 1. Revise the AWWW [1] to discuss the role of APIs and active content in general. 2. The process document [4] says “ … , the Working Group SHOULD be able to demonstrate two interoperable implementations of each feature.” Clarify what this means for APIs insofar as APIs are often embedded in, or used in context with, other languages. 3. Think through what we want to say about versioning and extensibility. It may be even more important for extended versions of APIs to work with old devices than for HTML to work with old browsers. 4. The failure model may be different. If the implementation does not understand a statement, what does it do: error, crash and burn, ignore? In typical interface definition languages, this is handled by describing exception cases which are documented for a particular interface. 5. Subverting the traditional client-server model of the Web (by allowing a client to effectively serve Web content via an API call) has implications (particularly in the areas of security and privacy) for the relationship between a client and a server. The Geolocation API [3] and the Device APIs Charter [2] both mention security and privacy policies but, as yet there are large disagreements on what shape such policies should take. This seems an important, fundamental area for future work. (One problem with policy is that in a web of autonomous, often anonymous agents, who will enforce policy and where will it be enforced? For example, is it sufficient for GPS devices just have a switch to turn off location broadcasting?) 6. There may be a need for guidance on how an API should be embedded in other Web content. For example, in Geolocation the host language identifies the device while the API specifies operations on the device. Similarly, if there is an error during the processing of an API request, how is that reported to the host content? 7. Testing APIs is different from testing protocols at least, in part due to wide variability in features between implementations of the API. For example, the Mobile Test Initiative has made a good start by publishing a note on how to write device-independent tests for mobile devices [5]. References [1] http://www.w3.org/TR/webarch/#protocol-interop [2] http://www.w3.org/2009/05/DeviceAPICharter [3] http://www.w3.org/2008/geolocation/drafts/API/ [4] http://www.w3.org/2005/10/Process-20051014/tr#rec-advance [5] http://www.w3.org/TR/2009/NOTE-di-testing-20090512/ [6] http://dev.w3.org/2006/webapi/WebIDL/ |
| Free embeddable forum powered by Nabble | Forum Help |