I don't want to begin some heated debate but I allways find the first method much easier to use. Am I representative in this case?
I think the Template Method is something that got to Perl from languages that can't so easilly pass subroutines around. People just got used to this. For example it is the traditional way of designing parsers.
Here are some links on that subject: Template Method (general description), Perl Design Patterns: Template Method, perl.com article on Perl Design Patterns
Update: After reading merlyns response I see that it really is about class parametrisation (the Template Method) versus object parametrisation (passing subroutines to constructor). And I must admit that both have their uses.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: Template Method contra passing subroutines to constructor.
by merlyn (Sage) on Jan 13, 2004 at 18:18 UTC | |
|
Re: Template Method contra passing subroutines to constructor.
by hardburn (Abbot) on Jan 13, 2004 at 19:02 UTC | |
|
Re: Template Method contra passing subroutines to constructor.
by perrin (Chancellor) on Jan 13, 2004 at 18:14 UTC | |
by hardburn (Abbot) on Jan 13, 2004 at 18:47 UTC | |
by perrin (Chancellor) on Jan 13, 2004 at 18:54 UTC | |
by hardburn (Abbot) on Jan 13, 2004 at 19:06 UTC | |
by perrin (Chancellor) on Jan 13, 2004 at 19:09 UTC |