Re: Calendar API: navigator ?

Hi Joćo,

thanks a lot for your feedback.

On Apr 20, 2011, at 15:18 , Joćo Eiras wrote:
> Just became aware of the calendar API
> 
>   http://www.w3.org/TR/calendar-api/

It was only released this week, so you aren't late :)

> I have one serious question: why placing the API inside the navigator object ?
> 
> That seems like unneeded indirection and overloading of navigator.
> Navigator is an object with completely different semantics which just
> contains info about the user agent and webpage environment (name,
> version, supported plugins and mime-types).
> 
> I would suggest making calendar global, like window.calendar and that
> way to remove a dependency.

We've had that discussion quite a few times. Essentially it boils down to this: we like to avoid polluting the global namespace, so we tend to avoid putting things on window unless it is absolutely necessary; and more importantly, the geolocation API, which is already widely deployed, has its entry point on navigator. It makes sense to follow in their path since a lot of developers are already familiar with that. Putting those APIs on the same access point makes them clearer. It is not rare that in specifying something we have to forget about the semantics of a name and go with common practice.

In general, if you think about it, all of these APIs (geolocation, calendar, contacts, etc.) are extra services that the user agent (i.e. the navigator) makes available to the page. So maybe it even sort of makes sense semantically :)

-- 
Robin Berjon - http://berjon.com/

Received on Wednesday, 20 April 2011 15:14:04 UTC