TAP::Parser should be *easier* to subclass

Steve Purkis steve.purkis at db.com
Tue Jun 3 10:04:51 UTC 2008


Hi all,

I just wanted to bring this to your attention, and maybe start a 
discussion on this:

http://rt.cpan.org/Ticket/Display.html?id=36397

Summary:
I've been trying to sub-class TAP::Parser to replace the 
TAP::Parser::Source::Perl module with a custom one, and am finding I'd 
have to re-implement a *lot* of code to do it.  I came to the conclusion 
that it would be easier to patch TAP::Parser to make this behaviour 
*easily* achievable than have to maintain a custom version of TAP::Parser. 
 I put together a patch for that (follow link above)

To make it even easier to subclass, I would recommend introducing a common 
base class for *all* TAP:: modules in the distro, eg: TAP::Base. The 
reason? Because there are currently a hundred different customized 'new' 
methods

Why would this help? Because I came across an _initialize method, and 
assumed it was being used everywhere. I was surprised (and annoyed) when I 
found out it wasn't. It's not consistent, which makes subclassing more 
painful that it should be.

I've only had time to put together a patch that covers the functionality I 
need to override.  I think more time will need to be spent on this to give 
TAP::* a more consistent, easy-to-subclass feel across the board.

Thoughts?

-Steve

---

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional EU corporate and regulatory disclosures.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.hexten.net/pipermail/tapx-dev/attachments/20080603/be737b81/attachment.htm 


More information about the tapx-dev mailing list