users@jersey.java.net

Bringing RESTful "connectedness" to my existing domain objects

From: Brett Dargan <brett.dargan_at_gmail.com>
Date: Wed, 14 Jan 2009 01:55:36 +1000

Hi Paul,

Well here is some sample code, named hateoas4legacy, it is really
rough in places, I'm almost embarrassed to put it up. But atleast it
gets it out there.

1 The sample enhances your model classes using AspectJ at compile time.
 - add a container for some Links
 - add Annotations that contain link templates around attributes or
methods or classes
2 Use a custom ContainerResponseFilter class of jersey to your
evaluate link templates at run time, using the data and any request
based information you may require.

I've posted about this with some instructions:
http://brettdargan.com/blog/2009/01/14/hateoas-for-legacy-object-models/

source code is available from here:
http://brettdargan.com/blog/wp-content/uploads/2009/01/hateoas4legacytar.bz2

mvn glassfish:run
./curl_test

cheers,
Brett.

PS. I've submitted a talk for this at java: S304410