Collection<T> vs. List<T>

38 views
Skip to first unread message

s89.k...@wittenberg.edu

unread,
Jun 4, 2009, 11:19:09 AM6/4/09
to GLUG.net-Certification Study Group
This is a good post:
http://blogs.msdn.com/kcwalina/archive/2005/09/23/Collections.aspx

Says should use List<T> whenever possible, it is optimized for best
performance. Use Collection<T> as a base class for a custom
collection when you need to build one.

This article also provides good information on List vs. Collection,
esp. with regards to the recommendation for why you shouldn't expose a
List<T> publicly.
http://blogs.msdn.com/fxcop/archive/2006/04/27/585476.aspx

Sean Whittier

unread,
Jun 4, 2009, 11:25:09 AM6/4/09
to glug-cert...@googlegroups.com
Much better one than any of the posts I found.  Thanks!

Mandeep Janjua

unread,
Jun 4, 2009, 3:46:03 PM6/4/09
to glug-cert...@googlegroups.com
hi,

this is a good book -


covers most of the details for designing public APIs like what type of methods should be placed in the parent classes, what type of collections should be used and where.

thanks,
Mandeep.



> Date: Thu, 4 Jun 2009 08:19:09 -0700
> Subject: Collection<T> vs. List<T>
> From: s89.k...@wittenberg.edu
> To: glug-cert...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages