I'm a huge fan of the framework. Part of my normal practice is running fxCop on code. While most of the time, I don't have any real 'issue', today I ran into a Microsoft reference to the use of List:
Error, Certainty 95, for DoNotExposeGenericLists
{
Target :
GetFields(System.String,System.String,System.String):System.Collections.Generic.List`1<Csla.Web.Design.ObjectFieldInfo> (IntrospectionTargetMethodBase)Location :
file:///C:/Code%2520Tools/CSLA/CSLA.NET%25202.1/csla20cs/csla20cs/Csla/Web/Design/TypeLoader.cs<183> (String)Resolution :
"Change 'System.Collections.Generic.List`1<Csla.Web.Design.ObjectFieldInfo>'in TypeLoader.GetFields(String, String, String):List`1<Csla.Web.Design.ObjectFieldInfo>
to use Collection<T>, ReadOnlyCollection<T> or KeyedCollection<K,
V>
"Help : http://www.gotdotnet.com/team/fxcop/docs/rules.aspx?version=1.35&url=/Design/DoNotExposeGenericLists.html (String)
Category : Microsoft.Design (String)
CheckId : CA1002 (String)
RuleFile : Design Rules (String)
Info : "Do not expose List<T> in object models. Use Collection<T>,
ReadOnlyCollection<T> or KeyedCollection<K,V> instead.
List<T> is meant to be used from implementation, not
in object model API. List<T> is optimized for performance
at the cost of long term versioning. For example, if
you return List<T> to the client code, you will not
ever be able to receive notifications when client code
modifies the collection."
Created :
10/11/2006 5:22:22 PM (DateTime)LastSeen :
10/11/2006 5:46:21 PM (DateTime)Status :
Active (MessageStatus)Fix Category :
Breaking (FixCategories)}
I'm sure there was a very valid reason for List<T>. I've read the book, but I did not see it. Any info would be great.
Thanks for a great framework!
-Don
Copyright (c) Marimer LLC