an API for them - whether to use two generic functions (set/get) or
one individual function for each array element. Eg:
$vars = array( 'userid' => $userid,
'password' => $password,
'nickname' => $nickname,
'address' => array( 'street' => $street,
'city' => $city,
'state' => $state,
'zip' => $zip ),
'gender' => $gender,
'age' => $age,
...
... );
function getVar( $key )
{ return $this->vars[ $key ); }
function setVar( $key, $value )
{ $this->vars[ $key ] = $value; }
OR:
===
function getUserId()
{ return $this->vars[ 'userid' ]; }
function setUserId( $userid )
{ $this->vars[ 'userid' ] = $userid; }
function getPassword()
function setPassword()
function getAddress()
function setAddress()
...
...
The $vars array has over 20 elements. Which approach would be neater
and recommended from the point of view of long-term maintainability.
Thanks,
The php_mysql group is dedicated to learn more about the PHP/MySQL web database possibilities through group learning.
YAHOO! GROUPS LINKS
- Visit your group "php_mysql" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
