On Apr 11, 2007, at 6:07 AM, Jerome Louvel wrote:
>
> I propose to unify Entity, HttpRequestContext and
> HttpResponseContext into a
> single Context class that could be inject at the local variable
> level and
> eventually at the parameter level.
>
You mean like HttpContext :-). You can already write:
@UriTemplate(...)
public class SomeResourceClass {
@Resource
HttpContext context;
...
}
The context field is initialized via injection when an instance is
created. The @Resource annotation is one of the common annotations
defined by JSR 250 and given that one can expect that this annotation
will be used in JSR 311 application classes I think we need to avoid
using the same name for any of our annotations :-(.
> It would be a two-way communication point with the API
> implementation and
> could contains methods such as:
>
> get/setInput(): Representation<T>
> get/setOutput() : Representation<T>
>
That is in line with the design of the context interfaces though
currently HttpRequestContext and HttpResponseContext manage the
request and response separately. We can discuss whether that is more
or less confusing than mixing the methods in a single interface.
Personally I quite like the separation.
Marc.
---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.
- application/pkcs7-signature attachment: smime.p7s