Very good, there's one simplification is that those methods with @GET
should just return 'this'.
Just make sure Customer id and name are set to some default values.

Your implementation is also correct though; if we rename Customer to
say Person then your code can handle  the family hierarchy case, etc;

Do you what I'm saying, why for the sake of the test you don;t have to
create new Customer() ? Effectively Customer becomes CustomerService
but I just wanted you to see that the root resource can return its own
state and act as a subresource too

Also, there's one problem with that code is that you have multiple
methods with @GET which is fine - but every GET method should be
unique enough (has unique @Path or Consumes or Produces)

Sergey
On Fri, May 13, 2011 at 12:47 PM, Ryan Zoerner <ryanzoer...@gmail.com> wrote:
> The full Customer.java class may be viewed here:
>
> http://pages.cs.wisc.edu/~zoerner/downloads/dev/samples/customerservice/Customer.java
>



-- 
Sergey Beryozkin

Application Integration Division of Talend
http://sberyozkin.blogspot.com

Reply via email to