Just another Perl shrine | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Greetings wise brothers. Comparing Moose and DBIx::Class, moose has a standard method for lazy attribute constructors. For example see: Moose::Cookbook::Recipe9. Is there a standard way of doing lazy constructors in DBIx::Class? Currently I am writing code like this: (For a read only attribute)
Is there a neater or more standard way of doing this? Something like an attribute passed to add_columns() to say that the field is lazy, so that a default named builder gets called when anything attempts to read it, and there is no need to explicitly declare the field as nullable (unless the builder is allowed to return undef), or name the builder, similar to Moose::Cookbook::Recipe9#The_lazy_build_shortcut. In reply to Lazy attributes on DBIx::Class collums? by chrestomanci
|
|