users@wadl.java.net

Re: Methods and id attributes

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Fri, 21 Aug 2009 09:48:20 -0400

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 ?

Marc.