tags:

views:

68

answers:

0

So, I'm coming up to speed on Jersey and have a "best practice" question. How strict should keep the resources self contained in one file. Should one resource class reference another class if needed?

An example:

I have a Person resource and an Appointment Resource. (ie: /Person/1 & /appointment/12345). I can also do something like /Person/1/Appointments to list all the appointments for person 1.

So, my question is should I implement a method getPersonAppointments() in the Person Resource class, or just someone get a reference to the Appointment resource class and call that method, keeping all the methods which return "Appointments" together.

I don't know that there is a right or a wrong way.