Syntactic Confectionery Delight | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
It seems to me that a factory pattern is exactly what he is doing here.
Not to quibble, but no, I don't think that's what "factory pattern" means. A factory hides the mechanics of constructing new objects behind another interface, whereas all of the instantiation done in this example is explicit. I'd say the OP is showing a behavior composition technique, like the GoF's Strategy pattern, expressed in proper Perl idiom. In reply to Re: Re: Re: how do you call this? $x->bar();
by simonm
|
|