dev@jsr311.java.net

Re: Summary: Representation<T> and Entity<T>

From: Ryan Heaton <ryan_at_webcohesion.com>
Date: Wed, 11 Apr 2007 06:30:57 -0600

Yes, thanks, Marc.

I don't have a problem with any of these assertions, and for cases
where metadata can be determined statically, I prefer the more
flexible approach of annotating the usage of the type.

Jerome, I'm sure you've probably repeated yourself a thousand times on
this, but what do you propose for cases where you can't annotate the
representation POJOs? Even in cases where you *can* annotate the
representation POJOs, though, I think I would prefer to keep separate
the concepts of *what* is being represented from *how* it's being
represented, like it is with the MVC pattern. I don't want to see
dependencies on the rest apis in my POJOs.

On different note (not sure this is the thread to offer this), I'd
like to offer my hope that we can shed the spi packages from the spec
in an attempt to reduce its complexity, as Jerome suggested.

-Ryan


On 4/11/07, Jerome Louvel <jerome.louvel_at_noelios.com> wrote:
>
> Thanks Marc for the accurate summary. I would only object to this line:
>
> > - Representation<T> is useful for cases where metadata can't be
> > determined statically
>
> If you can annotate the representation POJOs, then you could reuse the
> @MediaType annotation on a method dynamically returning this info:
>
> @MediaType
> public String getMimeType() {...}
>
> Best regards,
> Jerome
>
> > -----Message d'origine-----
> > De : Dhanji R. Prasanna [mailto:dhanji_at_gmail.com]
> > Envoyé : mercredi 11 avril 2007 05:54
> > À : dev_at_jsr311.dev.java.net
> > Objet : Re: Summary: Representation<T> and Entity<T>
> >
> > Great summary! Helps me too. We should have a digest like
> > this every week or something =).
> > I'll bet that'd be useful for people watching this thread
> > only occasionally.
> >
> >
> > On 4/11/07, Marc Hadley <Marc.Hadley_at_sun.com> wrote:
> >
> > On Apr 10, 2007, at 2:41 PM, Ryan Heaton wrote:
> > - Regardless of whether Entity<T> is retained or not we need a
> > general purpose mechanism to access request information - said
> > another way we shouldn't have to define a separate
> > annotation for
> > each piece of metadata.
> >
> >
> > Just want to clarify that by "we shouldn't have to..." you
> > mean the *end-user* shouldnt have to.
> >
> > The discussion is around whether jsr311 can offer both
> > granular metadata injection points (fine grained
> > @[MetadataItem] on method params--which may do some
> > parsing/type coercion) as well as a more raw glob of request
> > metadata: HttpRequestContext or (the less-http-gnostic)
> > EntityMetadata.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_jsr311.dev.java.net
> For additional commands, e-mail: dev-help_at_jsr311.dev.java.net
>
>