Hello,
there is only one instance of an Application (this principle also
applies to instances of Restlet sub classes) whereas instances of the
Resource class are generated at runtime. One instance of Resource is in
charge to handle one pair of Request/Response.
Generally, the constructor of a Resource is the place where you retrieve
the underlying business objects. This helps to know if your Resource is
available or not, what is it's current state, etc. Then the
acceptRepresentation, removeRepresentations, etc methods are the places
to implement business logic.
Best regards,
Thierry Boileau
--
Restlet ~ Core developer ~ http://www.restlet.org <http://www.restlet.org/>
Noelios Technologies ~ Co-founder ~ http://www.noelios.com
<http://www.noelios.com/>
i am creating a web application using Restlet based on MVC. i have
configured ServlerServlet to invoke my Application class, where i have all
the URI mappings. i am planning to use the Application class as controller
and Resource to implement business logic with other required patterns.
can any one suggest me whether this is the correct way to go ahead to
implement MVC application in RESTlet? how and when the Application will be
loaded? is it for every request or once per application ?
Thanks in advance.