View Single Post
Old 03-19-2008, 03:27 PM   #3 (permalink)
dschreck
The Contributor
 
dschreck's Avatar
 
Join Date: Nov 2007
Location: California
Posts: 82
Thanks: 0
dschreck is on a distinguished road
Default

in my experience, using a static method like in your first example is a lot easier and faster to type.

Usually I use static methods for carrying around instances of objects I will want. For example:
PHP Code:
$db Core::DB(); 
Returns my current instance of the database object.

I also use them for a quick authentication check:

PHP Code:
Auth::checkUser($_SESSION['Vars']['go']['Here']); 
I just find that it takes less time to type one line, and why should I create a whole new instance of an object just to run one method ?
__________________
Where I Ramble: http://www.iwilldomybest.com/
What I do: Zynga Game Network
Senior Software Engineer at CityVille
dschreck is offline  
Reply With Quote