Hi Jerome,
Jerome Louvel <contact <at> noelios.com> writes:
> Hi Sean,
>
> I understand your concerns. Here is an alternative, from your Resource, to
> retrieve the parent application:
> MyApplication app =
> (MyApplication)getContext().getAttributes().get("org.restlet.application");
>
> BTW, I've just added a new constant KEY to Application in SVN to simplify
> to:
> MyApplication app =
> (MyApplication)getContext().getAttributes().get(Application.KEY);
>
> Then, once you have your parent application, you can access to all your
> custom properties, in a type safe way. I hope this looks better to you than
> using attributes to store your shared state.
This is definitely a useful improvement, although in general I prefer to avoid
the use of context. By promoting a new variable as standard,
we reduce the risks I mentioned.
BTW, where are the standard context variables defined?
Thanks for all your effort and responsiveness!
Sean