Each thread gets its own unique copy of a page. It's not guaranteed
to be the *same* page each time a given user hits a page, but it's unique
within the context of that request so there are no problems with concurrent
access.
That being said, I make all my variables concrete because of my
innate, unnatural, and fogeyish fear of "fing magic" solutions that
automatically enhance my classfiles. The only gotcha is that you have to
re-initialize your instance variables to defaults when the page goes back
into the pool. So just make sure you implement the initialize() method on
your page.
--- Pat
> -----Original Message-----
> From: Leonardo Quijano Vincenzi [mailto:[EMAIL PROTECTED]
> Sent: Monday, September 05, 2005 11:05 AM
> To: Tapestry users
> Subject: Page instance variables
>
> Just 2 quick questions:
>
> 1) Is it allowed to put instance variables on a Tapestry Page? Such as:
>
> public abstract class SomePage extends Basepage {
> private int someField;
>
> }
>
> I guess there are issues with concurrent access, but I couldn't find any
> definite source on this (a FAQ entry maybe?).
> If I can't put it that way, then I'd have to declare getters and setters
> for every property I want to modify, right?
>
> 2) Should all page properties be abstract? Or I can declare a concrete
> property like this:
>
> public String getSomeProperty() {
> return String.format("...", getAnotherProperty());
> }
>
> I guess this property isn't modified on the dynamic page subclass.
>
> --
> Ing. Leonardo Quijano Vincenzi
> Director Técnico
> DTQ Software
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]