Hi Dhanji,
On Thu, 12 Apr 2007 18:20:23 +1000
"Dhanji R. Prasanna" <dhanji_at_gmail.com> wrote:
> On 4/12/07, Heiko Braun <hbraun_at_redhat.com> wrote:
> >
> > Hi Jerome,
> >
> > yes it will probably ignore that annotation,
> > but the mimeType property that would still get marshalled.
> >
> > I i did get you right, the @MediaType annotated property
> > should not become part of the actual (let's xml) representation on
> > the wire.
>
>
> Heiko:
>
> Couldnt you mark it transient? JAX-B (or JibX or XStream or whatever
> well-behaved serializer) should ignore the property then. The client
> (requestor) knows the mediatype from http headers anyway, assuming
> that we're both talking about the same "wire."
>
That's right. But it it simple? Take the possible way's to express this
times the number of representations and it becomes quiet complex.
The reason why i addressing this is that i favor Representation<T> to
contain meta-data, clearly separated from the actual payload. Paul
summarized this quiet well:
"Entity<T> and Representation<T> encapsulate the type to be
parsed/serialized, with common meta-data of the request and response,
respectively without requiring modification of that type."
Regards, Heiko