In .Net 2.0, Generics are introduced. I found that IEnumerable<T>
inherites from IEnumerable. This makes implementation of
IEnumerable<Thas to have two GetEnumerator methods defined( one for
IEnumerable<Tand the other for IEnumerable). I doubt why .Net class
hierarchy is designed in such a way. IMHO, they should not have
inheritance releationship, just like IList<Tand IList.
I googled the web and found two related articles.
http://www.wintellect.com/cs/blogs/p...numerable.aspx
http://blogs.msdn.com/brada/archive/...18/355755.aspx
But, the explanation is not satisfying.
Even though "IEnumerable<Tinherits from IEnumerable" seems follow
Liskov Substitution Principle, I believe, LSP is just a necessary
condition, not sufficent condition. And, If IEnumerable<Tdoesn't
inherit from IEnumerable, no old code would be broken.
Anybody can shed some light on that?