From: Dave Rolsky Date: Sun, 3 Aug 2008 17:53:31 +0000 (+0000) Subject: Add another TODO recipe, for hooking into the immutabilization X-Git-Tag: 0_55~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1acd5999d3888bd2257398b0d3778ffe9f7c9bb3;p=gitmo%2FMoose.git Add another TODO recipe, for hooking into the immutabilization system. This should come before meta-instance (which will at least reference immutabilization) --- diff --git a/lib/Moose/Cookbook.pod b/lib/Moose/Cookbook.pod index bd9840f..ce8763c 100644 --- a/lib/Moose/Cookbook.pod +++ b/lib/Moose/Cookbook.pod @@ -140,7 +140,22 @@ L as well. I -=item L - I (TODO) +=item L - Hooking into the immutabilization system (TODO) + +Moose has a feature known as "immutabilization". By calling C<< +__PACKAGE__->meta()->make_immutable() >> after defining your class +(attributes, roles, etc), you tell Moose to optimize things like +object creation, attribute access, and so on. + +If you are creating your own metaclasses, you may need to hook into +the immutabilization system. This cuts across a number of spots, +including the metaclass class, meta method classes, and possibly the +meta-instance class as well. + +This recipe shows you how to write extensions which immutabilize +properly. + +=item L - I (TODO) I