=head2 Methods
You already learned that a B<method> is a subroutine that operates on
-an object's data. You can think of a method as the things that an
-object can I<do>.
+an object. You can think of a method as the things that an object can
+I<do>.
In Perl, methods are simply subroutines that live in a class's package.
Methods are always written to receive the object as their first
B<Polymorphism> is a fancy way of saying that objects from two
different classes share an API. For example, we could have C<File> and
C<WebPage> classes which both have a C<print_content()> method. This
-method might produce different output for each class, but the basic API
-is the same.
+method might produce different output for each class, but they share a
+common interface.
While the two classes may differ in many ways, when it comes to the
C<print_content()> method, they are the same. This means that we can
=head2 Inheritance
-B<Inheritance> is a way to specialize an existing class. It allows one
-class to reuse the methods and attributes of another class.
+B<Inheritance> lets you create a specialized version of an existing
+class. Inheritance lets the new class to reuse the methods and
+attributes of another class.
-We often refer to inheritance relationships as B<parent-child> or
-C<superclass/subclass> relationships. Sometimes we say that the child
-has an B<is-a> relationship with its parent class.
-
-Inheritance is best used to create a specialized version of a class.
For example, we could create an C<File::MP3> class which B<inherits>
from C<File>. An C<File::MP3> B<is-a> I<more specific> type of C<File>.
All mp3 files are files, but not all files are mp3 files.
+We often refer to inheritance relationships as B<parent-child> or
+C<superclass/subclass> relationships. Sometimes we say that the child
+has an B<is-a> relationship with its parent class.
+
C<File> is a B<superclass> of C<File::MP3>, and C<File::MP3> is a
B<subclass> of C<File>.
Perl allows multiple inheritance, which means that a class can inherit
from multiple parents. While this is possible, we strongly recommend
against it. Generally, you can use B<roles> to do everything you can do
-with multiple inheritance in a cleaner way.
+with multiple inheritance, but in a cleaner way.
Note that there's nothing wrong with defining multiple subclasses of a
given class. This is both common and safe. For example, we might define
C<Moose> quite easily.
C<Mouse> does not implement most of C<Moose>'s introspection API, so
-it's often faster when loading your modules. Additionally, it has no
-I<required> non-core dependencies and can run without a compiler. If
-you do have a compiler, C<Mouse> will use it to compile some of its
-code for a speed boost.
+it's often faster when loading your modules. Additionally, all of its
+I<required> dependencies ship with the Perl core, and it can run
+without a compiler. If you do have a compiler, C<Mouse> will use it to
+compile some of its code for a speed boost.
-Finally, it ships with a C<C<Mouse>::Tiny> module that takes most of
+Finally, it ships with a C<Mouse::Tiny> module that takes most of
C<Mouse>'s features and bundles them up in a single module file. You
can copy this module file into your application's library directory for
easy bundling.