dev@jsr311.java.net

Re: Issue 1: Adding additional conneg metadata to _at_Produce/ConsumeXXX

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Mon, 18 Jun 2007 11:26:40 +0200

Jerome Louvel wrote:
>> Assuming you are thinking along the lines of the Restlet
>> design and that
>> i have understood things correctly... the developer still has
>> to perform
>> an if/else on the selected variant to know which one has been
>> selected
>> by the runtime, and would still have to return some actual content.
>
> Yes and no, because the actual content would be the Java object returned by
> the tagged method.
>
> To summarize: Restlet's Resource has a getVariants() method and a
> getRepresentation(Variant) one. JSR-311 could have several GET-annotated
> methods that would each represent an available representation (like toXml(),
> getInputStream(), getContent(), etc.). The Variant class would be replaced
> by metadata annotations.
>

Agreed, we can do that now with Produce*. But, the cases i am trying to
highlight are when what is acceptable cannot be determined statically:

1) a method is declared to produce more than one acceptable thing, for
example "image/*" but only certain image formats are supported, the
number of which grows over time; and

2) if we choose not to do non-declarative negotiation on certain
acceptable information, such as language (i suspect that for language
the common case is to grow the number of supported languages over time
without changing existing networking every time a new language is added).

Paul.

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109