users@jersey.java.net

Bringing RESTful "connectedness" to my existing domain objects

From: Brett Dargan <brett.dargan_at_gmail.com>
Date: Mon, 12 Jan 2009 09:47:15 +1000

I think I've got a reasonable solution now, at least for my situation, so I
can now "HATEOAS" enable my app/msgs which relies on independent and slowly
evolving legacy model .

1) Take some existing Model objects that are JAXB annotated.
2) I enhance them with aspectj, so I 1) add a new parent so they have a new
member, that is a list of links and 2) add inject
@ResourceLink(href="/some/resource/{code}") around attributes of methods I
want linked.
3) New Content Response Filter - that walks through the response.entity and
evaluates the href's in the marked annotations, using context of the data
and of the request/session.

cheers,
Brett.