Em Mon, 15 Dec 2008 06:47:18 -0300, Olle Hallin <olle.hal...@gmail.com> escreveu:

Hi,

Hi!

Beginning with 5.0.17 is is forbidden to have initial values on page
members, in order to prohibit state leakage between sessions.
This is fine, since it prevents bugs that can be very tricky to isolate.

You're right.

This contradicts to the Tapestry principle *the simplest choice should be
the correct choice.*

I don't think so. You have to remember that Tapestry polls page instances, so, after one request, Tapestry must restart the page fields values. And that the value of a non-primitive field is a reference to an object, not an object itself.

IMHO it should be ok to initialize the member in the declaration if it can be guaranteed that the value is immutable.

IMHO, the best way to declare a field that is immutable is to make it final and static (i.e. constant) for it, not a private field. ;)

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to