constraints vs attributes

I think that the Constrainable interface is based on three largely orthogonal features that distinguish it from attributes:

1.       The application can query the set of legal values for the property.  This is useful when the set of values is non-obvious, particularly when the set of values can vary from device to device.  (Supported screen resolutions would be an example.)

2.       The application can request a range of values, allowing the UA to choose within that range.

3.       The UA may ignore the application's request for certain values if it cannot satisfy it (and this is not treated as an error)

I think that Constrainable is appropriate when any of these three conditions holds.  Attributes are suitable when:

1.       There is no need to query the set of legal values because all devices support the same ones.

2.       The app needs only to specify a specific value (or ranges don't make sense).

3.       The UA must accept the value the app specifies (as long as it matches the attribute's type).

So things with Boolean values should be attributes (this is the opposite of what I said on the call).  So should things whose values can be any string or any int.


-          Jim

Received on Tuesday, 12 November 2013 07:39:25 UTC