Skip to main content
inline code formatting, minor cleanup
Source Link
Paul Bellora
  • 55.4k
  • 18
  • 135
  • 185

ArrayList versus an array of objects versus Collection of T  

I have a class named Customer Customer (with typical customer properties) and I need to pass around, and databind, a "chunk" of CustomerCustomer instances. Currently I'm using an array of CustomerCustomer, but I've also used CollectionCollection of TT (and ListList of TT before I knew about CollectionCollection of TT). I'd like the thinnest way to pass this chunk around using C# and .NET 3.5.

Currently, the array of CustomerCustomer is working just fine for me. It data binds well and seems to be as lightweight as it gets. I don't need the stuff ListList of TT offers and CollectionCollection of TT still seems like overkill. The array does require that I know ahead of time how many CustomersCustomers I'm adding to the chunk, but I always know that in advance (given rows in a page, for example).

Am I missing something fundamental or is the array of CustomerCustomer OK? Is there a tradeoff I'm missing.?

Also, I'm assuming that CollectionCollection of TT makes the old loosely-typed ArrayListArrayList obsolete. Am I right there?

Thanks

ArrayList versus an array of objects versus Collection of T  

I have a class named Customer (with typical customer properties) and I need to pass around, and databind, a "chunk" of Customer instances. Currently I'm using an array of Customer, but I've also used Collection of T (and List of T before I knew about Collection of T). I'd like the thinnest way to pass this chunk around using C# and .NET 3.5.

Currently, the array of Customer is working just fine for me. It data binds well and seems to be as lightweight as it gets. I don't need the stuff List of T offers and Collection of T still seems like overkill. The array does require that I know ahead of time how many Customers I'm adding to the chunk, but I always know that in advance (given rows in a page, for example).

Am I missing something fundamental or is the array of Customer OK? Is there a tradeoff I'm missing.

Also, I'm assuming that Collection of T makes the old loosely-typed ArrayList obsolete. Am I right there?

Thanks

ArrayList versus an array of objects versus Collection of T

I have a class Customer (with typical customer properties) and I need to pass around, and databind, a "chunk" of Customer instances. Currently I'm using an array of Customer, but I've also used Collection of T (and List of T before I knew about Collection of T). I'd like the thinnest way to pass this chunk around using C# and .NET 3.5.

Currently, the array of Customer is working just fine for me. It data binds well and seems to be as lightweight as it gets. I don't need the stuff List of T offers and Collection of T still seems like overkill. The array does require that I know ahead of time how many Customers I'm adding to the chunk, but I always know that in advance (given rows in a page, for example).

Am I missing something fundamental or is the array of Customer OK? Is there a tradeoff I'm missing?

Also, I'm assuming that Collection of T makes the old loosely-typed ArrayList obsolete. Am I right there?

Source Link
rp.
  • 17.7k
  • 14
  • 67
  • 80

ArrayList versus an array of objects versus Collection of T

I have a class named Customer (with typical customer properties) and I need to pass around, and databind, a "chunk" of Customer instances. Currently I'm using an array of Customer, but I've also used Collection of T (and List of T before I knew about Collection of T). I'd like the thinnest way to pass this chunk around using C# and .NET 3.5.

Currently, the array of Customer is working just fine for me. It data binds well and seems to be as lightweight as it gets. I don't need the stuff List of T offers and Collection of T still seems like overkill. The array does require that I know ahead of time how many Customers I'm adding to the chunk, but I always know that in advance (given rows in a page, for example).

Am I missing something fundamental or is the array of Customer OK? Is there a tradeoff I'm missing.

Also, I'm assuming that Collection of T makes the old loosely-typed ArrayList obsolete. Am I right there?

Thanks