Lazy Properties
Wanna be lazy?
component{
// Lazy property: Constructed by convention via the buildUtil() method
property name="util" lazy;
/**
* Build a util object lazyily.
* The first time you call it, it will lock, build it, and store it by convention as 'variables.util'
*/
function buildUtil(){
return new coldbox.system.core.util.Util();
}
}Implicit Builder
Explicit Builder
No Locking
Was this helpful?