On Sat Apr 09 08:00:03 2011, DAGOLDEN wrote:
Show quoted text> EU::MM can use lazy_validation if it can't be bothered to ensure
proper inputs.
MakeMaker is using lazy_validation. This particular ticket is about a
bug in CPAN::Meta's dclone implementation which rejects objects because
it happens to use a JSON parser to do the cloning. It's orthogonal to
validation.
Show quoted text> But I don't want to see version objects (or any objects) in CPAN::Meta.
>
> I'll add some validation to ensure all inputs are non-blessed and I'll
> add a converter to stringify anything it does find. So lazy_validation
> will normalize things correctly, but the default will be strict.
If I'm reading this correctly, the default will be to *not* honor object
stringification? This means any use of well behaved version objects or
file objects will have to be manually stringified before handing over to
CPAN::Meta? That's an encapsulation violation and a pain in the ass for
the user.
Since there's nothing wrong with using version or file objects for
things like version and provides, they're even built into the spec, that
would make lazy_validation effectively mandatory. Or everybody using
strict has to write a pre-filter... which means nobody will use strict
mode. While I understand you want to prevent someone from passing an
object in where it doesn't belong, erroring on every object makes strict
mode effectively useless.
In short, when is strict mode useful?