IList<T> versus Collection<T> as property

Posted by Brian Triplett on Stack Overflow See other posts from Stack Overflow or by Brian Triplett
Published on 2010-03-15T19:47:42Z Indexed on 2010/03/15 19:49 UTC
Read the original article Hit count: 153

Filed under:
|

I have a class with a internal array field. I want to expose this array as a property, such that it maintains as much funtionallity of the orginal array but does not violate abstraction by exposing the array directly. What are the various methods and pros and cons? I'm thinking specifically about IList<T> or Colleciton<T>

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET