Doh, slide on Bool was totally wrong
[gitmo/moose-presentations.git] / moose-class / slides / index.html
index df47d7d..7c57d21 100644 (file)
@@ -71,7 +71,8 @@ img#me05 {top: 43px;left: 36px;}
   <ul>
     <li><strong>Declarative</strong> OO sugar</li>
     <li>Introspectable</li>
-    <li>Extensible (MooseX::* on CPAN)</li>
+    <li>Extensible (177 MooseX::* on CPAN)</li>
+    <li>Community approved (1222 downstream dependents on CPAN)</li>
   </ul>
 </div>
 
@@ -892,8 +893,8 @@ use Moose;</code></pre>
   <h1>BUILDARGS</h1>
 
   <ul>
-    <li>Takes <code>@_</code>, returns a hash reference of attribute name/value pairs</li>
-    <li>Accepts a hash or hashref; throws otherwise</li>
+    <li>Processes <code>new</code>'s <code>@_</code>, returns a hash reference of attribute name/value pairs</li>
+    <li>Accepts a hash or hashref; errors otherwise</li>
     <li>Provide your own for other cases</li>
     <li><strong>Always</strong> call <code>$class-&gt;SUPER::BUILDARGS(@_)</code> as a fallback!</li>
   </ul>
@@ -967,6 +968,7 @@ sub BUILD {
   <ul>
     <li>Technically it's a hash reference</li>
     <li><span class="wrong">If you <em>ever</em> treat it as one <strong>you are doing it wrong!</strong></span></li>
+    <li>Moose probably provides a feature to do what you need</li>
   </ul>
 </div>
 
@@ -976,6 +978,7 @@ sub BUILD {
   <ul>
     <li>Like <code>DESTROY</code>, but Moose makes sure all <code>DEMOLISH</code> methods in a hierarchy are called</li>
     <li>Called in normal inheritance order, children to parents</li>
+    <li><em>Never</em> called by you, only by Perl itself</li>
   </ul>
 </div>
 
@@ -1039,6 +1042,7 @@ extends 'LWP';</code></pre>
   <ul>
     <li><code>override</code> is another method modifier</li>
     <li>An alternative to Perl's <code>SUPER::</code></li>
+    <li><em>Declares</em> your intent to override a method</li>
   </ul>
 </div>
 
@@ -1050,13 +1054,13 @@ use Moose;
 
 <span class="current incremental">extends 'Person';</span>
 
-<span class="incremental">override</span> work =&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">
@@ -1525,7 +1529,7 @@ use Moose;
 
 <span class="incremental">with 'HasSize';
 
-has size => ( is => 'ro' );</span></code></pre>
+has size =&gt; ( is =&gt; 'ro' );</span></code></pre>
 </div>
 
 <div class="slide">
@@ -1539,7 +1543,7 @@ requires 'size';
 package Shirt;
 use Moose;
 
-has size => ( is => 'ro' );
+has size =&gt; ( is =&gt; 'ro' );
 
 with 'HasSize';</code></pre>
 </div>
@@ -1561,9 +1565,9 @@ with 'HasSize';</code></pre>
   <pre><code>package Comparison;
 use Moose;
 
-has [ 'left', 'right' ] => (
-    is   => 'ro',
-    <span class="highlight">does => 'Comparable',</span>
+has [ 'left', 'right' ] =&gt; (
+    is   =&gt; 'ro',
+    <span class="highlight">does =&gt; 'Comparable',</span>
 );
 </code></pre>
 
@@ -1860,7 +1864,7 @@ has bank =&gt; (
 sub _build_bank {
     my $self = shift;
     return Bank-&gt;new(
-        name => 'Spire FCU' );
+        name =&gt; 'Spire FCU' );
 }</code></pre>
 </div>
 
@@ -1927,7 +1931,7 @@ has shoe_size =&gt; (
   <pre><code>has shoes =&gt; (
     is      =&gt; 'ro',
     <span class="highlight">lazy    =&gt; 1,</span>
-    builder => '_build_shoes',
+    builder =&gt; '_build_shoes',
 );
 
 sub _build_shoes {
@@ -2000,7 +2004,7 @@ has account =&gt; (
   <pre><code>package Person;
 use Moose;
 
-has shoe_size => (
+has shoe_size =&gt; (
     is       =&gt; 'ro',
     <span class="highlight">init_arg =&gt; 'foot_size',</span>
 );
@@ -2018,7 +2022,7 @@ print $person-&gt;shoe_size;</code></pre>
 <pre><code>package Person;
 use Moose;
 
-has shoes => (
+has shoes =&gt; (
     is       =&gt; 'ro',
     <span class="highlight">init_arg =&gt; undef,</span>
 );
@@ -2584,15 +2588,12 @@ Item
   <h1>Bool</h1>
 
   <h2>True</h2>
-  <pre><code>1
-924.1
-'true'
-{}</code></pre>
+  <pre><code>1</code></pre>
 
   <h2>False</h2>
   <pre><code>0
-0.0
 '0'
+''
 undef</code></pre>
 
   <ul>
@@ -3018,9 +3019,9 @@ coerce <span class="highlight">ArrayOfInt</span>
 
 use MyApp::Types qw( ArrayOfInt );
 
-has transaction_history => (
-    is  => 'rw',
-    isa => ArrayOfInt,
+has transaction_history =&gt; (
+    is  =&gt; 'rw',
+    isa =&gt; ArrayOfInt,
 );</code></pre>
 </div>
 
@@ -3204,7 +3205,7 @@ $alice-&gt;friend($bob);</code></pre>
 
 has lungs =&gt; (
     is      =&gt; 'ro',
-    isa     => 'Lungs',
+    isa     =&gt; 'Lungs',
     <span class="highlight">handles =&gt; [ 'inhale', 'exhale' ],</span>
 );</code></pre>
 
@@ -3535,10 +3536,6 @@ print <span class="highlight">Person-&gt;meta
 </div>
 
 <div class="slide">
-  <h1>Questions?</h1>
-</div>  
-
-<div class="slide">
   <h1>Exercises</h1>
 
   <pre># cd exercises
@@ -3549,28 +3546,17 @@ Iterate til this passes all its tests</pre>
 </div>
 
 <div class="slide">
-  <h1>Questions?</h1>
-</div>  
+  <h1>CYOA</h1>
 
-<div class="slide fake-slide0">
-  <h1>The End</h1>
-</div>
-
-<div class="slide">
-  <h1>More Information</h1>
+  <p>
+    If there is time, keep going ...
+  </p>
 
-  <ul>
-    <li><a href="http://moose.perl.org/">http://moose.perl.org/</a></li>
-    <li><a href="http://search.cpan.org/dist/Moose/lib/Moose/Manual.pod">Moose::Manual</a> and <a href="http://search.cpan.org/dist/Moose/lib/Moose/Cookbook.pod">Moose::Cookbook</a></li>
-    <li><a href="irc://irc.perl.org/#moose">irc://irc.perl.org/#moose</a></li>
-    <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://jules.scsys.co.uk/gitmo/moose-presentations</span></li>
-  </ul>
+  <p>
+    Otherwise, jump to slide 269 ...
+  </p>
 </div>
 
-
 <div class="slide fake-slide0">
   <h1>Bonus: A Brief Tour of MooseX</h1>
 </div>
@@ -3580,7 +3566,7 @@ Iterate til this passes all its tests</pre>
 
   <ul>
     <li><strong>Not comprehensive</strong></li>
-    <li>152 MooseX distributions on CPAN as of 02/02/2010</li>
+    <li>177 MooseX distributions on CPAN as of 09/21/2010</li>
     <li>Some of them are crap</li>
   </ul>
 </div>
@@ -3762,8 +3748,43 @@ use Moose;
 with HasCollection =&gt; { type =&gt; 'Int' };</code></pre>
 </div>
 
+<div class="slide">
+  <h1>Questions?</h1>
+</div>  
+
+<div class="slide">
+  <h1>Moose-using Modules</h1>
+
+  <p>
+    For further reading, a few modules which use Moose ...
+  </p>
+
+  <ul>
+    <li><a href="http://search.cpan.org/dist/Catalyst-Runtime">Catalyst</a></li>
+    <li><a href="http://search.cpan.org/dist/CHI">CHI</a></li>
+    <li><a href="http://search.cpan.org/dist/Devel-REPL">Devel::REPL</a></li>
+    <li><a href="http://search.cpan.org/dist/Email-Sender">Email::Sender</a></li>
+    <li><a href="http://search.cpan.org/dist/Fey">Fey</a></li>
+    <li><a href="http://search.cpan.org/dist/Net-Twitter">Net::Twitter</a></li>
+  </ul>
+</div>
+
+<div class="slide">
+  <h1>More Information</h1>
+
+  <ul>
+    <li><a href="http://moose.perl.org/">http://moose.perl.org/</a></li>
+    <li><a href="http://search.cpan.org/dist/Moose/lib/Moose/Manual.pod">Moose::Manual</a> and <a href="http://search.cpan.org/dist/Moose/lib/Moose/Cookbook.pod">Moose::Cookbook</a></li>
+    <li><a href="irc://irc.perl.org/#moose">irc://irc.perl.org/#moose</a></li>
+    <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://jules.scsys.co.uk/gitmo/moose-presentations</span></li>
+  </ul>
+</div>
+
 <div class="slide fake-slide0">
-  <h1>The End (Really)</h1>
+  <h1>The End</h1>
 </div>
 
 </div>