Groovy Goodness: Lazy Initialization of Properties - Messages from mrhaki
Sometimes we want the value of a property only to be calculated on first use. The calculation of the value can be time consuming or requires a lot of resources. In Groovy we can use the@Lazy
transformation to define a property we want to be initialized lazily. The value is not calculated or assigned until the value is requested. The transformation also allows a soft
parameter. This defines the field as soft reference.Read full article from Groovy Goodness: Lazy Initialization of Properties - Messages from mrhaki
No comments:
Post a Comment