RE: ISSUE-13: [API] Exception codes

Hello everyone,

One way to deal with extensibility is to keep the API itself clear of
definitions for the values of things and to rely on the ontology. In this
model, the API would have no mappings at all. It would simply say, use the
values from version xxx of the ontology (vocabulary or whatever).
Implementations could say which version of the ontology (with local
extensions if necessary) they actually support. Interoperability could be
achieved by mandating a particular version in the API specficiation as a
minimum.

If we don't use the ontology to do something like that, then we'll need to
maintain a mapping from ontology values to API enumerations in the API
spec itself at the very least. New values beyond those in use at the time
the spec was issued might require a new revision of the spec, which would
be undesirable.

I pointed out recently that CSS uses string abbreviation for units of
measure. This is a case in point. They are compact, don't require any
further mappings, are extensible and are represented directly in the
ontology. The XPath Access Functions in DISelect also use them directly
already, so there is at least some kind of precedent.

Best wishes
Rhys

-----Original Message-----
From: public-ddwg-request@w3.org [mailto:public-ddwg-request@w3.org] On
Behalf Of Rotan Hanrahan
Sent: 13 June 2007 16:29
To: public-ddwg@w3.org
Subject: RE: ISSUE-13: [API] Exception codes


[Moving to public list]

I agree with the desirability of exception inheritance. More in keeping
with what we're used to in OO.

I wonder a bit about the enum/extensibility argument. If we were going to
add more exceptions, then we would be rewriting (updating) the API.
So that means that we would be creating a new IDL. Which means we would
have an opportunity at that time to also extend the enum entries.

The advantage of using an enum is type safety.

The comment about extensibility [1] was made way back in 1998. I wonder if
the experience of extending the DOM since then has justified their
position, or would they have done things differently?

---Rotan


-----Original Message-----
From: member-ddwg-request@w3.org [mailto:member-ddwg-request@w3.org] On
Behalf Of Rodrigo Garcia Acevedo
Sent: 13 June 2007 15:15
To: Mobile Web Initiative Device Description Working Group WG
Subject: RE: ISSUE-13: [API] Exception codes


Hi.

The use of Exception codes instead of enum types (or different kinds of
exceptions) in other W3C specs had an explanation [1], it is easier to add
new codes for exceptions than to check for enum values. People thought it
favors extensibility.
As I am used to work with different object oriented languages I would
prefer to have exception inheritance, but it is not supported in OMG IDL,
so I think we should stick using exception codes.

Regards,
Rodrigo.

[1] http://lists.w3.org/Archives/Public/www-dom/1998JulSep/0289.html

-----Mensaje original-----
De: member-ddwg-request@w3.org [mailto:member-ddwg-request@w3.org] En
nombre de Mobile Web Initiative Device Description Working Group Issue
Tracker Enviado el: martes, 12 de junio de 2007 11:55
Para: member-ddwg@w3.org
Asunto: ISSUE-13: [API] Exception codes



ISSUE-13: [API] Exception codes

http://www.w3.org/2005/MWI/DDWG/Group/track/issues/13

Raised by: Jose Manuel Cantera Fonseca
On product: 

Should an explicit set of values be used for Exception codes, or should an
enum type be used? 

Received on Thursday, 14 June 2007 00:04:34 UTC