users@jersey.java.net

Re: Generating urls and controlling rendering/serialization

From: Jo Størset <jo.storset_at_usit.uio.no>
Date: Tue, 4 Mar 2008 01:55:39 +0100

Den 3. mars. 2008 kl. 19.13 skrev Marc Hadley:

>> Is that the kind of thing you are looking for ?

Yes, I was thinking that this is exactly the kind of support that
would be needed to make rest development clean and simple. But since
I'm new to this, I was kind of hoping others would have a better
understanding than me :)

In our own resource centric web solution, we have the notion of
services applied to resources in a content repository. These services,
like jersey resources, are used both for mapping requests to
funcionality and for generating urls to the service on specific
resources (service.createLink(Resource resource) more or less). In
this scenario all resources have a path (id), which I believe
corresponds to your use of the @id and @ResourceClass annotations.
Wouldn't this be very helpful for building clean, maintainable rest
style apps?

On JPA, I don't use JPA myself, and I don't know how clean it would be
to use jpa @id annotations in a generalized way. But i guess it would
be doable?

I was also thinking about the possibility of rest annotating the model
resources directly (since the annotations themselves constitutes a
level above the resources), instead of making an explicit resource
layer. But I guess this would be quite intrusive to the current way of
doing layering of apps, since the access methods don't really belong
in the resource. Maybe I should be looking to the seam way of building
apps, since it seems geared towards this type of merging of the web
and resource layer. Does anybody else have any ideas in this regard?

Jo