<h1>Cleaning Up Moose Droppings</h1>
<pre><code>package Person;
-<span class="highlight">use namespace::autoclean;</span>
use Moose;
+<span class="highlight">use namespace::autoclean;</span>
...
</div>
<div class="slide">
- <h1>Name Conflicts Between Roles</h1>
-
- <pre><code>package HasSubProcess;
-use Moose::Role;
-
-<span class="highlight">sub execute { ... }</span>
+ <h1>Roles as Interfaces</h1>
-package Killer;
-use Moose::Role;
-
-with 'HasSubProcess';
-
-<span class="highlight">sub execute { ... }</span></code></pre>
+ <ul>
+ <li>Roles can <code>require</code> methods of their consumers</li>
+ <li>Compile-time checks</li>
+ <li>Method must exist when the role is consumed</li>
+ </ul>
</div>
<div class="slide">
<li>alter parameters passed to the original method</li>
<li>alter the return value of the original method</li>
<li>not call the original method at all (or call a <em>different</em> method)</li>
- <li>When using modifiers in a role, require the modified method</li>
</ul>
</li>
+ <li>When using modifiers in a role, require the modified method</li>
</ul>
</div>
<h1>Digression: The Type Registry</h1>
<ul>
- <li>Types are actually <code>Moose::Meta::TypeConstraints</code> <em>objects</em></li>
+ <li>Types are actually <code>Moose::Meta::TypeConstraint</code> <em>objects</em></li>
<li>Stored in an interpreter-global registry mapping names to objects</li>
</ul>
</div>