On Tuesday 27 Apr 2010 19:17:25 Dave Rolsky wrote:
> On Tue, 27 Apr 2010, Shlomi Fish wrote:
> > Wouldn't it mean that perl will call the _build_paragraph_name of the
> > sub- class upon every instantiation of an object? I could be prematurely
> > micro- optimising in thinking that it matters, though.
>
> Yes, you are prematurely optimizing.
>
True, however, there are different reasons why I dislike having such a
class/type-based constant as a has field:
1. One can mutate it in the instance (including at run-time) by assigning to
$self->{_bold_tag_name}.
2. A more philosophical reason (and more major) is that I feel that "has()"
fields, which are stored inside the object's instance are *instance-based
data* while what I'm looking for is global class/subclass-based data and
constants.
As a result, I think I'll go with my original way, but maybe use "required ''"
to make sure such a method is defined in the non-abstract and production-ready
subclasses.
Regards,
Shlomi Fish
--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
Rethinking CPAN - http://shlom.in/rethinking-cpan
God considered inflicting XSLT as the tenth plague of Egypt, but then
decided against it because he thought it would be too evil.
Please reply to list if it's a mailing list post - http://shlom.in/reply .