Hi Tariq,

On Feb 26, 2010, at 5:33 AM, [email protected] wrote:

> I would like to know why instances of "resource" classes cannot be  
> dynamically created at runtime like the "application" class.

Resources _are_ instantiated dynamically at runtime -- one instance  
per request (assuming that the request gets routed to a Resource).   
The Restlet which handles this instantiation is is the Finder.  You  
can use a custom Router subclass to use a different Finder  
implementation if the default behavior doesn't work for you.

Can you give an example of what you're trying to do?

Rhett

> The idea is that I would like to initialize the resource class  
> instance depending on different data that is acquired during  
> runtime, and hence handle interactions differently.
>
> An alternative to this is to just handle the requests at the  
> "application" without the use of the resource class. But I would  
> like to use the resource class so that I could automatically  
> generate WADLs using the respective extension class(es).
>
> Many thanks,
> Tariq
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2452502

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

Reply via email to