users@jersey.java.net

Re: [Jersey] Generating WS client based on reflection

From: Santiago Pericas-Geertsen <Santiago.Pericasgeertsen_at_Sun.COM>
Date: Thu, 03 Dec 2009 09:53:53 -0500

On Dec 3, 2009, at 7:12 AM, Paul Sandoz wrote:

> How do you think this would look if one were not proxy to resources
> but to links of representations (be it headers or in the content)?
> i.e. the client side does not use @Path as the links are declared by
> server in the returned representations.

  Using links in representations seems definitely more RESTy.

>
> Warning brain dump mode...
>
> WebResource r = ...
> Purchase b = r.get(Purchase.class)

  s/b/p right?

>
> OrderType ot = ...
> Order o = p.purchase(ot); // This performs a post on an
> appropriate URI declared
> // in representation
> returned from initial GET request
>
> o.update(ot);
> WebResource or = o.getResource();
> or.delete();
>
>
> Purchase is not a JAXB bean but a proxy that knows about possible
> link types returned in the representation of r. Thus Purchase may be
> defined in terms of link types and maybe XPath expressions.

  Just to make sure I understand it, you mean Purchase is an interface
implemented by a dynamically generated proxy class of which 'p' is an
instance? If so, even though the proxy class can be generated
dynamically, the interface Purchase must be known statically in Java.

  Is there a bootstrap process in your brain that you can dump?

-- Santiago