[Moose-commits] r7490 - Moose/trunk/lib/Moose/Manual
autarch at code2.0beta.co.uk
autarch at code2.0beta.co.uk
Tue Feb 3 16:29:05 GMT 2009
Author: autarch
Date: 2009-02-03 08:29:05 -0800 (Tue, 03 Feb 2009)
New Revision: 7490
Modified:
Moose/trunk/lib/Moose/Manual/Delegation.pod
Log:
Tetx tweaks for delegation manual
Modified: Moose/trunk/lib/Moose/Manual/Delegation.pod
===================================================================
--- Moose/trunk/lib/Moose/Manual/Delegation.pod 2009-02-03 15:57:31 UTC (rev 7489)
+++ Moose/trunk/lib/Moose/Manual/Delegation.pod 2009-02-03 16:29:05 UTC (rev 7490)
@@ -6,18 +6,18 @@
=head1 WHAT IS DELEGATION?
-Moose's delegation feature lets you create "shadow" methods that do
-nothing more than call some other method on an attribute. This is
-quite handy since it lets you simplify a complex set of "has-a"
+Delegation is a feature that lets you create create "shadow" methods
+that do nothing more than call some other method on an attribute. This
+is quite handy since it lets you simplify a complex set of "has-a"
relationships and present a single unified API from one class.
-This means that consumers of a class don't need to know about all the
-objects it contains, and it simplifies their code.
+With delegation, consumers of a class don't need to know about all the
+objects it contains, reducing the amount of API they need to learn.
Delegations are defined as a mapping between one or more methods
provided by the "real" class (the delegatee), and a set of
corresponding methods in the delegating class. The delegating class
-can re-use the method names provided by the delegatee, or provide its
+can re-use the method names provided by the delegatee or provide its
own names.
Delegation is also a great way to wrap an existing class, especially a
@@ -97,8 +97,9 @@
=head1 MISSING ATTRIBUTES
It is perfectly valid to delegate methods to an attribute which is not
-required, or can be undefined. In that case, Moose will throw a
-runtime error when a delegated method is called.
+required or can be undefined. When a delegated method is called, Moose
+will throw a runtime error if the attribute does not contain an
+object.
=head1 AUTHOR
More information about the Moose-commits
mailing list