Tapestry does a very clever trick when it comes to member variables on
Components and Pages. It re-writes the byte code of the class so that all
member variable access is done via getters(). It then re-writes the getters
so that it looks up the variables from thread local maps instead of from
the component instance itself.

This way, tapestry can maintain singleton instances for Components and
Pages to reduce the memory footprint whilst maintaining thread safety.

Tapestry does one more trick in development mode and that is to write
variables to the thread local maps and also to the singleton component/page
instance to make debugging easier. This is switched off in production.

On Friday, 23 March 2012, karthi <rathinasamy....@snovabits.net> wrote:
> Hi,
>
>   I have a class called Test in my project
>
> public class Test {
>
> private List<NewsItem> newsItems;
>
> }
>
> Will tapestry creates this object every time when called or initialize
once
> & reuse every time like servlet?
>
> --
> View this message in context:
http://tapestry.1045711.n5.nabble.com/Tapestry-class-variables-behavior-tp5588887p5588887.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

Reply via email to