From: Shawn M Moore Date: Sun, 10 May 2009 16:30:40 +0000 (-0400) Subject: Answer "why an object" X-Git-Tag: 0.06~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=70afb58daccc23d3434ed5699683a4d7e7ccca8d;p=gitmo%2FMooseX-Role-Parameterized.git Answer "why an object" --- diff --git a/lib/MooseX/Role/Parameterized.pm b/lib/MooseX/Role/Parameterized.pm index 2ec5f18..13fb745 100644 --- a/lib/MooseX/Role/Parameterized.pm +++ b/lib/MooseX/Role/Parameterized.pm @@ -234,7 +234,22 @@ role however you wish. There are many possible implementations for parameterized roles (hopefully with a consistent enough API); I believe this to be the easiest and most flexible -design. Coincidentally, Pugs has an eerily similar design. +design. Coincidentally, Pugs originally had an eerily similar design. + +=head2 Why a parameters object? + +I've been asked several times "Why use a parameter I and not just a +parameter I? That would eliminate the need to explicitly declare your +parameters." + +The benefits of using an object are similar to the benefits of using Moose. You +get an easy way to specify lazy defaults, type constraint, delegation, and so +on. You get to use MooseX modules. + +You also get the usual introspective and intercessory abilities that come +standard with the metaobject protocol. Ambitious users should be able to add +traits to the parameters metaclass to further customize behavior. Please let +me know if you're doing anything viciously complicated with this extension. :) =head1 CAVEATS