Array of idNumbers, or collection of objects?
Posted: Fri Aug 07, 2009 12:10 pm
by pillick >> Fri, 26 Jul 2002 2:43:20 GMT
Say I have an object with many fields, one of which is the field idNumber. I have a collection class for this object, which uses idNumber as the primary key.
For one of my processes, the only part of the object I am interested in is the idNumber. Should I use a collection of the objects themselves, or just use an array of the idnumbers?
The collections or arrays have to be stored persistantly. So I am worried about the amount of space to store each of these, as well as the preformance of searching for particular idNumbers.
So which should I use?
Say I have an object with many fields, one of which is the field idNumber. I have a collection class for this object, which uses idNumber as the primary key.
For one of my processes, the only part of the object I am interested in is the idNumber. Should I use a collection of the objects themselves, or just use an array of the idnumbers?
The collections or arrays have to be stored persistantly. So I am worried about the amount of space to store each of these, as well as the preformance of searching for particular idNumbers.
So which should I use?