[PEPr] Comment on PHP::PHP_Callback
| From: | Johannes Schl�ter | Date: | Sun, 06 May 2007 09:17:07 +0000 |
| Subject: | [PEPr] Comment on PHP::PHP_Callback | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-46635@lists.php.net to get a copy of this message | ||
Johannes Schlüter (http://pear.php.net/user/johannes) has commented on the proposal for
PHP::PHP_Callback.
Comment:
Ok, I don't really care but I think one point was missed in this whole
discussion: How often do you really need a general purpose callback
mechanism?
In my experience my "callbacks" need to handle specific parameters or
something like that. But these aren't checked by this package. But there's
a technology in PHP which is quite good for this: It's called "interfaces".
IN places I want to have a custom callback I expect a object implementing a
specific interface and call a method on that.
In cases where you need a special purpose callback one should also think
on the API usability - it's nice to think on developers of PEAR classes but
I think it's way more important to think on the average user using the
package. I think every PEAR user knows PHP callbacks (from usort(),
preg_replace_callback(), ....) so using that should be straight forward.
But using PHP_Callback the user first has to find out what PHP_Callback is
and how to use it and as a user, not being interested in implementation
details, this looks "strange".
Feel free to ignore my comment - I won't vote anyways :-)
Proposal information:
http://pear.php.net/pepr/pepr-proposal-show.php?id=482
--
Sent by PEPr, the automatic proposal system at http://pear.php.net