Re: PEAR_Callback proposal

From: Date: Fri, 05 Jan 2007 18:47:18 +0000
Subject: Re: PEAR_Callback proposal
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-45441@lists.php.net to get a copy of this message
Hi, Lukas Feiler wrote:
A couple of days ago I proposed the package PEAR_Callback; see http://pear.php.net/pepr/pepr-proposal-show.php?id=468 It addresses three major limitations of the callback pseudo-type: - By looking at a callback pseudo-type variable you cannot tell if it really is a callback. - The callback pseudo-type does not allow you to specify arguments at the time you create the callback. - There is no way to force a user to pass only callback functions to your API, that meet certain requirements (i.e. accept certain arguments and have a certain return type)
All of these major limitations can be overcome by using the Command design pattern: http://en.wikipedia.org/wiki/Command_pattern I don't honestly see the benefit for PEAR in adding a wrapper around functions when all these checks are already available for classes / objects in PHP5.

« previous php.pear.dev (#45441) next »