Hi,

I am new to Restlet and any similar technology and I am wondering about the 
right approach to share business and data objects (eg. Hibernate) among Restlet 
Resources.

After reading the books, docs and older posts in this forum, I know why the 
Component Context shall not be used to pass information to the Resource 
Restlets. I have also seen people talking different approaches:

1) Create an singleton that provides access to the shared objects. I personally 
dislike singleton approaches.

2) Put the shared objects as attributes to the Application Context. This 
requires (implicit) conventions about attribute names and casting. And requires 
going through each Resource Restlet if some of the convention changes.

3) Extend the Context with getter methods for shared objects. Objects are 
stored as variables inside the Context. Resources then cast the Context and 
call the getter methods.

4) Extend the Application with getter methods for shared objects. Objects are 
stored as variables inside the Application. Resources then cast the Application 
and call the getter methods.

5) Some better approach that I am missing?

Sorry if the question is quite elementary, but I am not familiar to 
webservice/restlet development. I will appreciate your advice.

Thanks,
Daniel Felix Ferber

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2462248

Reply via email to