W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2009

[DataCache] Remove or Replace a Local Server Handler?

From: Joseph Pecoraro <joepeck02@gmail.com>
Date: Thu, 17 Dec 2009 00:31:09 -0500
Message-Id: <0BAFA075-0FA4-4303-ADAF-F985015AE830@gmail.com>
To: public-webapps@w3.org
There is no way to remove a handler, or all handlers for a particular
namespace, after some have been registered. However, this may be a
valid design decision, because there probably aren't compelling use
cases for removing or replacing handlers. The only time I ran into
this need was running multiple tests in a single html file reusing
the same namespace (uri).

How about an application that wants to seamlessly update its offline
handlers without reloading the page? It would need to download a
script that removes the old handlers, and installs the new handlers.

Does this sound useful and practical?



As it stands right now, the Spec should be more specific about how
registerOfflineHandler handles multiple handlers registered on the
same namespace.

  var namespace = ...
  navigator.registerOfflineHandler(namespace, ..., ...); // 1st
  navigator.registerOfflineHandler(namespace, ..., ...); // 2nd

Possible scenarios:

  1. The 2nd replaces (and removes) the 1st.
  2. Both remain, the earliest registered handler is the final candidate
  3. Both remain, the latest registered handler is the final candidate
  4. A different heuristic.

I would prefer scenario #1. It doesn't make sense to have two different
handlers for the exact same namespace.  This also cuts down on potential
memory leaks, references to dead/unreachable code.

- Joe
Received on Thursday, 17 December 2009 05:31:45 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:35 GMT