If a collection of parameterizations that would have been passed as coderefs into a constructor deserve "a life of their own", then the override method makes more sense. You create a named class that contains the code to create this newly-abled object.
So, some objects have instance-specific behavior, while other objects share behavior.
For an interesting way to eliminate the distinction, see the Self language, or look at Perl workalikes like Class::Prototyped.
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
In reply to •Re: Template Method contra passing subroutines to constructor.
by merlyn
in thread Template Method contra passing subroutines to constructor.
by zby
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |