Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Daniel O'Connor <daniel.oconnor <at> gmail.com>
Subject: [PEPr] Comment on Images::Image_Diff
Newsgroups: gmane.comp.php.pear.devel
Date: Friday 4th September 2009 05:57:56 UTC (over 7 years ago)
Is there any compelling reason to make these static methods?



Being static means I can't mock them out, and makes them more like
namespaced functions than an Image_Diffing object.



Ie:

Image_Diff::nearlySame()



could easily be



$diff = new Image_Diff();

$diff->nearlySame();



while having none of the drawbacks of statics
(http://misko.hevery.com/code-reviewers-guide/flaw-brittle-global-state-singletons/)

-- 
http://pear.php.net/pepr/pepr-proposal-show.php?id=611

-- 
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
 
CD: 20ms