Re: [widgets] feature: inconsistent behavior ?

On Wednesday, January 6, 2010, Cyril Concolato <cyril.concolato@enst.fr> wrote:
> Le 05/01/2010 23:54, Marcos Caceres a écrit :
>
> On Wed, Dec 16, 2009 at 10:13 AM, Cyril Concolato
> <cyril.concolato@enst.fr>  wrote:
>
> Hi,
>
> The test df.wgt contains a feature without name. In this case, the feature
> element is ignored and the widget remains valid.
> The test d4.wgt contains an invalid feature name. In this case, the widget
> should be considered as invalid. I don't understand that. I understand the
> rationale that if a feature is required, the UA shall not process the
> widget. Whether it does or not understand the feature, it doesn't matter. Is
> it because you foresee evolution in the syntax of feature names, which
> wouldn't be IRI ? If not, I suggest to make this test pass and ignore the
> feature element.
>
>
>
> Sorry, but it was a resolution that all correctly named features are
> considered required (it's why we had to create the required
> attribute). I'm against changing this.
>
> It's not because "all correctly named features are considered required" (on which I agree) that "invalid feature names must lead to invalid widgets" (on which I disagree). I think invalid feature names should be ignored.
>

But they (the invalid feature) are "required" by default (required
value defaults to true), hence the widget would probably crash or be
rendered useless at runtime regardless. Consider:

<feature name='foo:bar'/>

which manifests itself as 'window.theMightyFoo' at runtime, iff the
feature is available. The author, having implicitly said in the config
doc "feature foo:bar must be there for my widget to work" will have to
now write additional error handling code to check if the feature is
available. This would be fine if the author said:

<feature name='foo:bar' required='false'/>

in which case, the author has made an explicit statement that he or
she has (hopefully) coded the widget on the premise that the feature
may not be there at runtime.


-- 
Marcos Caceres
http://datadriven.com.au

Received on Wednesday, 6 January 2010 09:52:43 UTC