dev@jsr311.java.net

Re: Representation<T> and Entity<T>

From: Heiko Braun <hbraun_at_redhat.com>
Date: Wed, 11 Apr 2007 16:00:19 +0200

On Tue, 10 Apr 2007 14:20:48 +0200
Paul Sandoz <Paul.Sandoz_at_Sun.COM> wrote:

> Jerome Louvel wrote:
> >> IMHO this puts more work on the developer. They have to
> >> create their own
> >> code for some very common cases.
> >
> > How does it put more work on the developer?
>
> Because a developer has to create their own annotated class for such
> common cases, like you did, rather than *reuse* Representation<T>.
>
>
> > The Entry POJO class is
> > necessary in all cases. Maybe you want Entry to extends a base
> > Entity/Representation class?
> >
>
> No need. 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.
>

+1

This does additionally create a clear distinction between the
311 run-time and the payload it produces/consumes.
IMO this is a desirable design goal.

> Paul.
>