Re: implementing a Tapestry IoC annotation to cache method results

2012-12-31 Thread Lance Java
The "watch" parameter will reset the cache if another property changes. Consider a loop: ${transformedItem.someProperty} public class MyPage @Property private Item item; public List getItems() { ... } @Cached(watch="item") public TransformedItem getTransformedItem

Re: implementing a Tapestry IoC annotation to cache method results

2012-12-31 Thread John
thanks, that could do the job - but is there any example of using the watch parameter? - Original Message - From: Lance Java To: users@tapestry.apache.org Sent: Monday, December 31, 2012 8:49 AM Subject: Re: implementing a Tapestry IoC annotation to cache method results

Re: implementing a Tapestry IoC annotation to cache method results

2012-12-31 Thread Lance Java
Are you aware of the @Cached annotation? When used on a component/page method, only the first invocation will invoke the method. Subsequent calls will use a cached value. http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/annotations/Cached.html http://tapestry.apache.org/tapestry5/