Using multiple functions for returning or one main function
Posted: Sat May 03, 2008 10:51 pm
Let's say I have a User class.
This User class has some variables, namely id, name, date_of_birth, username etc.
Should I just create one separate function to return each attribute?
Or would it be better to create just one main function and return all the User variables as array items?
I'm guessing the first one should be less taxing for the database. But requires a lot more coding.
This User class has some variables, namely id, name, date_of_birth, username etc.
Should I just create one separate function to return each attribute?
Or would it be better to create just one main function and return all the User variables as array items?
I'm guessing the first one should be less taxing for the database. But requires a lot more coding.