title: When should I make a Moose class immutable when I'm actually using ->meta?
body: <p>Normally I would finalize a class at compilation via <code>__PACKAGE__-&gt;meta-&gt;make_immutable</code> at the end of the class. However, when should I be making a class immutable that composes roles into itself at runtime? Should I even be doing so to get better performance or is this imcompatible with <code>make_immutable</code>? <code>make_immutable</code> seems to speed up instantiation of the object, but does it do anything once the object is instantiated?</p>
  
  <p>For example, something along the lines of:</p>
  
  <pre><code>BUILD {
    my $self = shift;
    use Module::Load;
  
    ### Use the arguments passed in to determine roles applicable to 
    ### this instance of the object. Load and apply roles.
    for my $role ($self-&gt;_determine_roles()) { 
      load $role;
      $role-&gt;meta-&gt;apply($self);
    }
  
    ### $self is now a Class::MOP::Class::__ANON__... anonymous class
    ### Should I then be saying I'm done mutating it with something like this?
    ### can make_immutable even be run on an object instance and not a package?
    $self-&gt;meta-&gt;make_immutable;
  }
  </code></pre>
  
  <p>Even if the code above works for a single package, what happens when a object reblesses itself with the <code>'Foo'</code> role, resulting in a anonymous class, then a second object blesses itself with a <code>'Foo'</code> (becoming that same anon class) then <code>'Bar'</code> role? Is it going to work correctly when the second object blesses itself into the immutable first anonymous class, then tries applying the role to the now-immutable anonymous class to create a new anonymous class?</p>
  
  <p>From reading the docs on <a href="http://search.cpan.org/perldoc?Moose%3a%3aMeta%3a%3aClass" rel="nofollow">Moose::Meta::Class</a>, it appears only a class can be immutable, not instances of objects. If so, should I just be ignoring <code>make_immutable</code> as I am mutating my classes?</p>