View Single Post
Old 06-08-2009, 07:06 PM   #4 (permalink)
ioan1k
The Contributor
 
ioan1k's Avatar
 
Join Date: Mar 2009
Location: US
Posts: 76
Thanks: 0
ioan1k is on a distinguished road
Default

I use the top 2 .... depending on where and how I will be retrieving the data and what the data is that I will be retrieving.
Example for each
------------------------------------------------------------------
Public Member Variables
Almost 99% of all public calls I make are routed into overloading using __get, __set, __isset, __unset which are taken from a registry

PHP Code:
$a = new Foo_Top();
echo 
$a->username
Will overload into something such as __get() -> Static_Registry()::get() -> return Or null

Individual Methods
I use ind. functions for data I will be calling that is a class property.
PHP Code:
$b = new Foo_Jar();
$b->getAppleCount(); 
returns the number of apples, same goes for setting, while it might seem pointless, it is much to debug and write code knowing exactly where and when you get and set a property

__call Overload
Most code I will write does not allow __call overloading

Function When Arguments Required (Methods)
If you are requiring arguments, you will more than likely be performing some kind of logic; you are not really explicitly retrieving data only within the class as it will is likely to be manipulated in some form
__________________
My Portfolio - Work - Need freelance Work?
I've been developing 5 years now, and I learn something new everyday
ioan1k is offline  
Reply With Quote