Re: [PEPr] +1 for Authentication::OpenID
| From: | Josh Hoyt | Date: | Thu, 09 Feb 2006 17:52:29 +0000 |
| Subject: | Re: [PEPr] +1 for Authentication::OpenID | ||
| References: | 1 2 3 4 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-41271@lists.php.net to get a copy of this message | ||
Scott,
On 2/9/06, Scott Mattocks <scott@crisscott.com> wrote:
> > Should we just create an arbitrary class (like Auth_OpenID) and dump
> > all of the functions in it? The functions that we have that are not
> > methods are not related to each other and do not naturally go in a
> > particular class.
>
> Yes. It will give others the ability to extend and modify your class to
> create new functionality. I can't extend a function.
I promise I'll leave this alone after this, but I don't buy your
argument. If the class is never instantiated (it's all static
methods), then how do you extend it? Unless there is a trick that I
don't know about, calling a static method is just as rigid as calling
a function.
Given:
function Pkg_foo(...) {...}
and
class Pkg {
/**
* @static
*/
function foo(...) {...}
}
it's no more flexible to write
Pkg::foo()
then it is to write
Pkg_foo()
since the caller must refer to Pkg by name.
Josh