users@wadl.java.net

Re: Methods and id attributes

From: Sergey Beryozkin <sberyozk_at_progress.com>
Date: Fri, 21 Aug 2009 15:26:57 +0100

Hi


> On Aug 21, 2009, at 6:44 AM, Sergey Beryozkin wrote:
>>
>> The WADL spec says that 'id' attributes are allowed on global method declarations only but the sample on page 3 shows that a
>> local method tag also has an id attribute.
>> So can this restriction be relaxed so that id attrubutes can be put on local method elements ? I'd rather do it rather than
>> introducing some custom extensions....
>
> Well spotted !
>
> The issue with id attributes on local method elements is that you could then refer to them from elsewhere and the problem with
> that is what context to carry over, e.g. is a resource-wide parameter carried over to the referring resource or resource_type
> from the local containing resource. It also means that processors have to scan every method rather than just global ones when
> looking for the target of a reference.
>
> On balance I think I prefer retaining the restriction and fixing the example. What do others think ?

The reason I'd not mind having 'id' on local methods or indeed on local resources is that it provides some additional
information to the codegen tools, mainly to those which can generate proxies. I appreciate this is not something WADL has probably
been designed in mind with :-) but if say future specs like JAX-RS 2.0 will end up supporting client proxies then this information
might become handy - in fact I've asked this question after coming across a WADL sample generated by JAXRS RI recently.
Another use of 'id' is that it can really provide a very short doc info like 'search' in the example on the page 3, the UI tools
might use this short info if no explicit docs is available. The specification might also want to say that processors are not
required to resolve method references to methods which are not defined globally, thus addressing an issue of the processing
complexity and also say that it basically up to the implementers what to do with local id attributes on methods/resources.

 So I'd prefer to have the restriction relaxed though I can see the schema also allowing for external attributes on methods so
custom attributes can be added if needed.

cheers, Sergey

>
> Marc.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_wadl.dev.java.net
> For additional commands, e-mail: users-help_at_wadl.dev.java.net
>