W3C home > Mailing lists > Public > public-device-apis@w3.org > November 2009

Re: APIs Design patterns

From: Robin Berjon <robin@robineko.com>
Date: Thu, 19 Nov 2009 10:56:05 +0100
Cc: Marcin Hanclik <Marcin.Hanclik@access-company.com>, "public-device-apis@w3.org" <public-device-apis@w3.org>
Message-Id: <D8E3B1A5-92BD-48B6-9803-6CDDC53490B1@robineko.com>
To: Dominique Hazael-Massieux <dom@w3.org>
Hi Marcin, Dom,

On Nov 19, 2009, at 09:34 , Dominique Hazael-Massieux wrote:
>  I think the most useful thing the document should do is to record API
> design issues that have arisen in WebApps, Geolocation and DAP (see
> below for some examples), and document the outcome of the discussions
> (with a clear guidance when there is one, or simply with cons and pros
> when the outcome is not a clear cut)

Right, the fact is that we have to fit in an already rather large body of APIs, some of which are good, some of which are bad and rejected, and yet some more are considered bad but kept because sometimes the cost of making a bad idea go away is higher than that of living with it.

>  as a result, I would stay away from using RFC2119 keywords as much as
> possible

Much agreed. For me the greatest value in documenting patterns is so that we don't have to explain everything again every time someone new joins the WG. Equally, none of these rules are set in stone  in following the priority order "users over authors over implementors over specifiers over theoretical purity" adherence to patterns comes at the end, so giving the impression that they may be normative is misleading.

Some of these items will probably not be possible. For instance "All APIs must follow the same convention when handling callback functions" won't really be possible as depending on the use cases callbacks or events make more sense. I take this as an example of a case where trying to create universal patterns won't work. That's why I think that this document would be best written as a set of Best Practices (like MWBP for instance), it's all about "shoulds" and trade-offs.

--
Robin Berjon
  robineko  hired gun, higher standards
  http://robineko.com/
Received on Thursday, 19 November 2009 09:56:42 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:14:01 GMT