> What do you think is better a collection of objects, or an array of objects ?
> Collections seem to be res. complicated, where as an array of objects is simple as.
> Anyone have any thoughts ?
It always depends upon your circumstances.
Array Pros
- Small code.
- Rapid random access and sequenctial access.
- No storage overhead (inter-element storage).
Array Cons
- Only efficient in a fixed size
- Sorting elements can be expensive. Especially since array don't hold an intrinsic
order.
- requires a large contiguous memory allocation which can be innefficient to page in
and out of main memory.
- no added-value fuctionality available.
Collections Pros.
- under the covers the collection can be stored in an efficient method
to match the retrieval models.
- Added-value functionality can be added in an OO fashion which encapsulates code
nicely.
- Better capability for scaling.
- incremental allocation of resources.
Collections Cons
- Complexity of implementation
- performance is worse than array for small amounts of data which fit the array
requirements.
- Storage overheads on some effective indexing/ordering models can be quite high.
--
Aaron Scott-Boddendijk
Jump Productions
(07) 838-3371 Voice
(07) 838-3372 Fax
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"