>> @Property >> private Date addedToJumpstart = new Date("2010-07-14"); > > Never initialize fields like you've done in the above snippet because of the > page pooling. Use the activate or begin render event to initialize fields. >
In general that's sound advice, but if you look at the use case here he's building a constant (maybe it should actually be a constant?) Also, Date is an immutable object so using it as an initializer is safe. The danger with field initializers is that they'll be saved as the default value for the field and modifications can be unpredictable. So, don't use mutable objects to initialize fields unless you are really sure about what you are doing. Josh On Wed, Jul 14, 2010 at 8:43 AM, Thiago H. de Paula Figueiredo <thiag...@gmail.com> wrote: > On Wed, 14 Jul 2010 11:13:07 -0300, Chris Mylonas <ch...@mrvoip.com.au> > wrote: > >> .java >> @Property >> private Date addedToJumpstart = new Date("2010-07-14"); > > Never initialize fields like you've done in the above snippet because of the > page pooling. Use the activate or begin render event to initialize fields. > > -- > Thiago H. de Paula Figueiredo > Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and > instructor > Owner, Ars Machina Tecnologia da Informação Ltda. > http://www.arsmachina.com.br > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- -- http://www.bodylabgym.com - a private, by appointment only, one-on-one health and fitness facility. -- http://www.ectransition.com - Quality Electronic Cigarettes at a reasonable price! -- TheDailyTube.com. Sign up and get the best new videos on the internet delivered fresh to your inbox. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org