Mandy Warren
unread,Mar 12, 2013, 5:09:30 PM3/12/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to api-...@googlegroups.com
Hi,
I was looking for some guidance on naming conventions for the Java class which provides the implementation of the REST service (ie. the Root Resource Class).
In Spring examples it is named with the suffix Controller, in Apache CXF they seem to use the suffix Service and in Jersey they use the suffix Resource.
My gut feel is to use the suffix Resource as to my mind a REST Resource encompass the URI path plus the supported HTTP methods. This does mean that I need to clearly distinguish between the Root Resource class and the class which holds the JSON/XML representation of the Resource data. I am considering this package/class naming convention:
package xxx.resources - contains classes which are Root Resources named with the suffix Resource, eg. AccountResource.java
package xxx.domain - contains classes which represent the Resource data named as per the Resource but without the Resource Suffix eg. Account.java
Any thoughts / recommendations would be much appreciated!
Thanks
Mandy