T4: Instance method dangers

2007-08-16 Thread Bill Holloway
I want to cache a rountrip to a database in an instance method of a page class like this: public FlowDataPageContent getFlowDataPageContent() { if (_pageContent == null) { _pageContent = getContentService().getFlowDataPageContent(/* some data in an ASO

Re: T4: Instance method dangers

2007-08-16 Thread Jesse Kuhnert
It's thread safe. A more elegant method may be to push the caching out to something more generic like your database or object caching strategies such as is used in things like hibernate. Some properties - such as those passed in as parameters to components - are sometimes cached by tapestry

Re: T4: Instance method dangers

2007-08-16 Thread Bill Holloway
Thanks! I'll talk to the service layer/Spring people tomorrow about pushing the caching down into the service there. They've been thinking about using os cache or something. bill On 8/16/07, Jesse Kuhnert [EMAIL PROTECTED] wrote: It's thread safe. A more elegant method may be to push the