On Sat, May 31, 2014 at 12:57:23PM -0400, Steve Hay via RT wrote:
Show quoted text> Very close but not quite.
In ways that I'm not sure I'd want, but can see the use of.
Show quoted text> C::D::I::T is also 'friendly' like Class::Accessor (but unlike Class::Data::Inheritable, despite requests in CPAN RT#6281 and #51228) in not overwriting existing existing (accessor) methods, whereas C::D::A and C::A::G just blindly overwrites them.
Which makes CDA/CAG usable as a drop-in replacement in places CDIT isn't.
ISTR C::A didn't used to be 'friendly' and its becoming so broke a bunch of
code.
This is a trade-off though; Moo(se) are 'friendly'.
Possibly worth documenting for people who care about that more than they
care about the other things CDIT brings to the table.
Show quoted text> I will certainly add a note to C::D::I::T's documentation mentioning the other modules (C::A::G in particulr, since C::D::A is itself deprecated in favour of C::A::G (or Moose)), but I would not personally want to switch away from using it without C::A::G at least having the means to 'reset' a previously overridden attribute on an object.
I've largely concluded that mutable class data is a terrible idea anyway,
and these days would use an attribute with a lazy builder and a clearer to
get class-default-object-overridable-with-reset-option. i.e.
has foo => (is => 'lazy', builder => sub { 3 }, clearer => 1);
which installs the 'sub { 3 }' as _build_foo, so subclasses can simply define
their own if they want a default class-level default.
However, the above is meant to be informational rather than an argument for
conversion to that approach, and I concur that adding a note in the docs and
leaving the module be is probably correct.
Actually, given how informative your reply was, I think linking to this
ticket from the docs might also be a good thing, but I'll leave that choice
up to you :)
--
Matt S Trout - Shadowcat Systems - Perl consulting with a commit bit and a clue
http://shadowcat.co.uk/blog/matt-s-trout/ http://twitter.com/shadowcat_mst/
Email me now on mst (at) shadowcat.co.uk and let's chat about how our CPAN
commercial support, training and consultancy packages could help your team.