Keep It Simple, Stupid | |
PerlMonks |
Re: Re: XML::Parser Tutorialby merlyn (Sage) |
on Mar 07, 2001 at 21:11 UTC ( [id://62785]=note: print w/replies, xml ) | Need Help?? |
Why do you want to subclass it? It works much better as a "has-a" than an "is-a", unless you want to get very cozy from the base class implementation, which is a maze of twisty tiny packages all alike.
Just delegate the methods that you want to provide in your interface, and handle the rest. Make a hash with one of the elements being your "inherited" parser. I believe it's called the "wrapper" pattern, but I don't name my patterns—I just use them! -- Randal L. Schwartz, Perl hacker
In Section
Tutorials
|
|