Use Printable role in example of class consuming a role
[gitmo/moose-presentations.git] / moose-class / slides / index.html
index 2f3c9d3..b193f68 100644 (file)
@@ -71,8 +71,8 @@ img#me05 {top: 43px;left: 36px;}
   <ul>
     <li><strong>Declarative</strong> OO sugar</li>
     <li>Introspectable</li>
-    <li>Extensible (177 MooseX::* on CPAN)</li>
-    <li>Community approved (1222 downstream dependents on CPAN)</li>
+    <li>Extensible (188 MooseX::* on CPAN)</li>
+    <li>Community approved (1200+ downstream dependents on CPAN)</li>
   </ul>
 </div>
 
@@ -155,7 +155,7 @@ img#me05 {top: 43px;left: 36px;}
   <pre><code>package Person;
 use Moose;
 
-<span class="highlight">has first_name =&gt; ( is =&gt; 'rw' );</span></code></pre>
+<span class="highlight">has first_name =&gt; ( is =&gt; 'ro' );</span></code></pre>
 
 </div>
 
@@ -1054,13 +1054,13 @@ use Moose;
 
 <span class="current incremental">extends 'Person';</span>
 
-<span class="incremental">override</span> <span class="incremental">work</span> =&gt; sub {
+<span class="incremental">override</span> <span class="incremental">work</span> <span class="incremental">=&gt; sub {
     my $self = shift;
 
     die "Pay me first"
         unless $self-&gt;got_paid;
-    <span class="incremental">super();</span>
-}<span class="incremental">;</span></code></pre>
+    super();
+}</span><span class="incremental">;</span></code></pre>
 </div>
 
 <div class="slide">
@@ -1069,7 +1069,7 @@ use Moose;
   <ul>
     <li>Mostly like <code>$self-&gt;SUPER::work(@_)</code></li>
     <li><strong>But</strong> cannot change <code>@_</code>!</li>
-    <li>Binds the parent's method at compile time</li>
+    <li>Binds the parent's method <strong>correctly</strong> at compile time</li>
     <li>Parent determined by checking <code>Child-&gt;meta()-&gt;superclasses()</code></li>
   </ul>
 </div>
@@ -1236,6 +1236,8 @@ use Moose;
 
 # perl install-moose (if needed)
 
+## Read the instructions in t/01-classes.t
+
 # perl bin/prove -lv t/01-classes.t
 
 # edit lib/Person.pm and lib/Employee.pm
@@ -1307,30 +1309,30 @@ sub print {
   <pre><code>package Person;
 use Moose;
 
-with 'HasPermissions';</code></pre>
+with 'Printable';</code></pre>
 </div>
 
 <div class="slide">
   <h1>Classes Consume Roles</h1>
 
-<pre><code>my $person = Person-&gt;new(
+<pre><code>package Person;
+
+sub as_string { $_[0]-&gt;first_name() }
+
+my $person = Person-&gt;new(
     first_name   =&gt; 'Kenichi',
     last_name    =&gt; 'Asai',
     access_level =&gt; 42,
 );
 
-print $person-&gt;full_name
-    . ' has '
-    . $person-&gt;can_access(42)
-        ? 'great power'
-        : 'little power';</code></pre>
+$person-&gt;print();</code></pre>
 </div>
 
 <div class="slide">
   <h1>Roles in Practice</h1>
 
   <ul>
-    <li>Consuming a role &#x2248; inlining the role</li>
+    <li>Consuming a role =~ inlining the role</li>
   </ul>
 </div>
 
@@ -3779,7 +3781,7 @@ with HasCollection =&gt; { type =&gt; 'Int' };</code></pre>
     <li>mailing list - <a href="mailto:moose@perl.org">moose@perl.org</a></li>
     <li>Slides and exercises are in Moose's git repo:
         <br />
-        <span style="font-size:80%; white-space: nowrap">git://git.moose.perl.org/moose-presentations/moose.git</span></li>
+        <span style="font-size:80%; white-space: nowrap">git://jules.scsys.co.uk/gitmo/moose-presentations</span></li>
   </ul>
 </div>