|
|
Object or Array??
Hello there...
I have a little issue here....
Which one is better(I think object) but would like to hear from someone more
experienced....
class Persons
{
var $name;
var $comments;
var $thoughts;
var $email;
some functions.....
}
object in array:
while($line = $result->FetchRow()) //using ADODB
{
$person[$line['id']] = &new Persons;
$person[$line['id']]->name = $line['name'];
$person[$line['id']]->thoughts = $line['thoughts'];
$person[$line['id']]->email = $line['email'];
$person[$line['id']]->comments = $line['comments'];
}
or plain array:
while($line = $result->FetchRow())
$person[$line['id']]=Array("name"=>$line['name'],"thoughts"=>$line['thoughts
'],"email"=>$line['email'],"comments"=>$line['comments']);
thanx and respect....
p.
|
|
0
|
|
|
|
Reply
|
point5404 (24)
|
9/7/2003 9:53:24 AM |
|
"point" <point@caanNOSPAMproduction.com> wrote
in message news:<bjev3q02vgv@enews2.newsguy.com>...
>
> Which one is better (I think object) but would like to hear
> from someone more experienced....
Define "better". Better for what? Reusability? Go with objects.
Performance? Stick with arrays and stop using abstraction layers.
Cheers,
NC
|
|
0
|
|
|
|
Reply
|
nc (1051)
|
9/7/2003 7:27:00 PM
|
|
Thanx for your oppinions....
I'm sticking with objects just wanted to hear your oppinions....
In my oppinion objects are more close(although more abstract) to human way
of thinking than the procedural programing.....
respect....
"point" <point@caanNOSPAMproduction.com> wrote in message
news:bjev3q02vgv@enews2.newsguy.com...
> Hello there...
>
> I have a little issue here....
>
> Which one is better(I think object) but would like to hear from someone
more
> experienced....
>
> class Persons
> {
> var $name;
> var $comments;
> var $thoughts;
> var $email;
>
> some functions.....
> }
>
> object in array:
>
> while($line = $result->FetchRow()) //using ADODB
> {
> $person[$line['id']] = &new Persons;
> $person[$line['id']]->name = $line['name'];
> $person[$line['id']]->thoughts = $line['thoughts'];
> $person[$line['id']]->email = $line['email'];
> $person[$line['id']]->comments = $line['comments'];
> }
>
> or plain array:
>
> while($line = $result->FetchRow())
>
>
$person[$line['id']]=Array("name"=>$line['name'],"thoughts"=>$line['thoughts
> '],"email"=>$line['email'],"comments"=>$line['comments']);
>
> thanx and respect....
>
> p.
>
>
>
>
|
|
0
|
|
|
|
Reply
|
point5404 (24)
|
9/8/2003 7:27:02 PM
|
|
|
2 Replies
31 Views
(page loaded in 0.053 seconds)
Similiar Articles: Modifying Select Elements in Array of Objects - comp.lang.ruby ...Hi, I have an array of objects, and the objects have some attributes. I'd like to be able to modify selected elements in the array based on any o... MAT file takes forever to save with big object array - comp.soft ...Hi, I have a 65k-element array of objects of a particular class. >> whos results Name Size Bytes Class ... Neatest way to get the end pointer? - comp.lang.cA pointer to a non-array object type is indicated by the standard to be the same thing as a pointer to the beginning of array of length 1. -- "Is there any thing ... Vertex Array Implementation - comp.graphics.api.openglThe vertex_buffer_object extension lets you put the arrays on the card so they never need copying. -- <\___/> For email, remove my socks. GL_ARRAY_BUFFER_ARB vs. GL_ARRAY_BUFFER - comp.graphics.api.opengl ...OpenGL Vertex Buffer Object (VBO) - Song Ho Ahn Target is a hint to tell VBO whether this buffer object will store vertex array data or index array data: GL_ARRAY_BUFFER ... OLE object and GetFullMatrix error - comp.soft-sys.matlab ...Solved mine too. It was not the same issue. I realized that the output array MUST HAVE EXACTLY THE SAME LENGTH as the array in the Matlab server. Indirect object referencing (PDF parsing) - comp.text.pdf ...... so equally you can just miss things. > >Are indirect object references used only inside dictionary objects No, they could be used inside other objects, such as an array ... write read string data - comp.lang.java.helpYou open the input as a >>> BufferedReader, test whether an array is equal to the BufferedReader >>> object (it isn't), ignore the result of the test, and close the input ... converting .NET System.String objects to matlab strings - comp ...Convery .Net Array to MatLab Array in MatLab - comp.soft-sys ... For all other types, use the MATLAB NET ... .NET Arrays to Cell Arrays. You can convert .NET System ... Const constructor - comp.lang.c++.moderatedConstructing user-defined array like objects does not. The way of fixing this is to introduce sequence constructors. Of course, you can simply make the builtin types ... GL_ATI_vertex_array_objectName ATI_vertex_array_object Name Strings GL_ATI_vertex_array_object Contact Rick Hammerstone, AMD (rick.hammerstone 'at' amd.com) Version 1.11 - 11/04/06 Retrieving an Array ObjectAfter the root object is obtained by creating an instance of the FPC object, all the array-level configuration settings defined in the hierarchy of administration COM ... 7/15/2012 1:04:49 PM
|
|
|
|
|
|
|
|
|