in reply to Re^2: Moose is lovely
in thread Moose is lovely
Very nice, I am glad you are enjoying Moose :)
Just one suggestion, if your "default" subs get large, it is usualy a good idea to convert them to 'builder' methods instead. You can find this feature documented in Class::MOP::Attribute. This:
is basically a shortcut for:has 'foo' => ( builder => 'build_foo' );
It also gives the added benefit that any subclasses can easily override 'build_foo' themselves to get additional behavior.has 'foo' => ( default => sub { (shift)->build_foo } );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Moose is lovely
by revdiablo (Prior) on Feb 29, 2008 at 20:26 UTC | |
by stvn (Monsignor) on Feb 29, 2008 at 22:26 UTC | |
|
Re^4: Moose is lovely
by ysth (Canon) on Feb 29, 2008 at 19:32 UTC | |
by stvn (Monsignor) on Feb 29, 2008 at 20:02 UTC | |
by nothingmuch (Priest) on Feb 29, 2008 at 20:09 UTC |