From: Dave Rolsky Date: Tue, 3 Feb 2009 16:29:05 +0000 (+0000) Subject: Tetx tweaks for delegation manual X-Git-Tag: 0.66~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d3e02c74c2e4ad955afa406437dfc5e48f24af97;p=gitmo%2FMoose.git Tetx tweaks for delegation manual --- diff --git a/lib/Moose/Manual/Delegation.pod b/lib/Moose/Manual/Delegation.pod index 306a5f9..804f7f9 100644 --- a/lib/Moose/Manual/Delegation.pod +++ b/lib/Moose/Manual/Delegation.pod @@ -6,18 +6,18 @@ Moose::Manual::Attribute - Attribute Delegation =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 @@ L docs for more details on exactly how this works. =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