dev@jsr311.java.net

RE: Representation<T> and Entity<T>

From: Jerome Louvel <jerome.louvel_at_noelios.com>
Date: Wed, 11 Apr 2007 12:26:48 +0200

Dhanji,

> Even if this is not possible, the @MediaType annotation
> should be present on ANY parameter indicating the mediatype
> for clarity.

Agreed.

> Jerome: is there a reason you want the general I/O annotation
> versus a specific Produce and Consume for Mimes, languages etc.?
> I think for such a fundamental thing as content types and
> charsets, a special annotation would be better than a
> catchall @Input or @Output.

Because, the @Input annotation can let you inject the whole representation
as a method parameter for example, instead of only particular metadata. But,
I think that we also need the specific metadata annotations: @MediaType,
@CharacterSet, @Encoding, etc.

> Actually, I am in favor of the @MediaType annotation on
> parameter types and methods to indicate production and
> consumption content types. This seems more explicit in that
> you are indicating the the media type on the (injected)
> parameter as oppose to @ConsumeMime on the method--which
> would make more sense if the method could (also) consume
> content thru some other way than as a parameter.
>
> Or, are you saying @Input and @Output is intended on the
> entity class directly?

No, on the entity class, we should only allow the usage of the
@Representation annotation (in addition to the metadata annotation) as it
could be used for both input and output purpose.

Best regards,
Jerome