NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
use Moose (Score:1)
Well, you could duplicate all of this functionality and require no MI at all using Moose and the Class::MOP meta level (the only forced inheritance being Moose::Object, but even that is optional). This all too common abuse of inheritance was one of the main reasons I wrote Moose the way I did. Having the meta layer allows you to add behavior to classes which belong with the class and not with any object instances created by the class (your classic OO "seperation of concerns"). Some of this behavior could easily be implemented with Roles as well (or in a non-Moose world using Class::Trait).
As for the question ...
Well, the first thing that I saw was this line from the Class::Blackhole docs. Which is then immeditely followed by this line: I hate to say it, but I think your "bug" is less a case for the evils of MI, and more a case of not RTFM.- Stevan
Reply to This
Re: (Score:2)
Heh. Point taken :)
It's also worth noting that two of those classes provide their own constructor. Hmm, which should I use? Can I use both? Must I use both? All the more reason to provide that functionality without inheritance.
Speaking of Moose (which I really like, though I've yet to have used it in a production environment, how's it's performance coming along?
Re: (Score:1)
Well, the startup cost is still kind of high because we do so much in the compile phase, but if you are in a persistent environment that is a moot point. The runtime speed is basically "fast enough" for most people and making your class immutable only increases that.
The most basic accessors are actually faster than Class::Accessor, of course if you add type constrai