Krzysztof Cwalina
Designing Reusable Frameworks
Browse by Tags
All Tags
»
System.Collections
(RSS)
Design Guidelines
General API Design
General Programming
Simulated Covariance for .NET Generics
I just wrote this pattern, but I am not sure if I should add it officially to the Framework Design Guidelines. It seems like a bit of a corner case scenario, though I do get questions about it from time to time. Anyway, let me know what you think. Different
Read More...
Synchronization at the Right Level
I get a lot of questions about why the new generic collection interfaces (IList<T> for example) do not support synchronization. There are several reasons for it. One, probably the main, is that in practice synchronizing on the level of a single
Read More...
C5 Collections
Peter Sestoft and his team just released a library of collections for the CLI called C5 Collections . Unlike the Power Collections , this library introduces many new abstractions that are not present in the .NET Framework. The benefit of such approach
Read More...
Disposable Collection
Somebody asked me today, if we have a collection that is disposable and calls dispose on all its items when the collections.Dispose method is called. You can implement such collection by inheriting from List<T> and adding Dispose logic. If you add
Read More...
Immutable Collections
I just saw an interesting post that talks about a general pattern of immutable reference types. Good read. I highly recommend it! At the end of the post the author suggests that we add “value object” generic collection to the BCL. It’s an interesting
Read More...
Why we don’t recommend using List<T> in public APIs
We don’t recommend using List<T> in public APIs for two reasons. List<T> is not designed to be extended. i.e. you cannot override any members. This for example means that an object returning List<T> from a property won’t be able to get
Read More...
System.Collections vs. System.Collection.Generic and System.Collections.ObjectModel
Many people ask how the new.NET Framework 2.0 generic collections relate to the non-generic collections we shipped before. So, here you go. The most important types are in bold font. List<T> is basically a better ArrayList. It is optimized for speed,
Read More...
List<T> vs. ArrayList Performance
Rico just posted a new performance quiz where he compares performance of List<T> and ArrayList in some simple scenarios. List<T> is my Whidbey baby, so of course I had to answer that List<T> is faster :-)
Read More...
PowerCollections Beta Avaliable
The beta release of the PowerCollections library has been posted today. See http://wintellect.com/WEBLOGS/pgolde/archive/2005/06/03/1304.aspx .
Read More...
Generic interfaces, IsReadOnly, IsFixedSize, and array
Peter Golde recently posted about the IsReadOnly and IsFixedSize change we made to the generic collection interfaces.There are also several other discussions around the net on this topic. I thought I write up something to explain the motivation and our
Read More...
The reason why Collection
, ReadOnlyCollection
, and KeyedCollection
were moved to System.Collections.ObjectModel namespace
Several people asked me why Collection<T>, ReadOnlyCollection<T>, and KeyedCollection<TKey,TValue> were moved to System.Collections.ObjectModel namespace. Here are the two main reasons: 1. Microsoft.VisualBasic namespace contains a non-generic
Read More...
The reason why IEnumerator
extens IDisposable
Lot ’s of people asked me why IEnumerator<T> extends IDisposable. We did this to support some obscure, yet important scenarios where an enumerator enumerates database rows, or files in a directory, etc. In such cases, the enumerator usually opens
Read More...
Power Collections on GotDotNet Featured Sites
I just noticed that the Power Collections project made it to the “Featured Sites” on GotDotNet. See http://www.gotdotnet.com/content/featuredsite/powercollections/default.aspx For those who don’t know, Power Collections is a community open source library
Read More...
IComaprer
& IComparable
Refactoring Proposal
We are exploring the possiblility of changing the design of IComparer<T> and IComparable<T> interfaces that will ship with Whidbey. This post describes some more detail on the issues we are trying to address with the design change and we are
Read More...
System.Collections.Generic Dictionary
Capacity, Hashing, and Collisions.
Somebody asked me a question how to set the initial capacity of System.Collections.Generic.Dictionary<K,V> if one knows that the Dictionary will contain 1000 entries. The short answer Dictionary<int,string> numbers = new Dictionary<int,string>(1000);
Read More...
More Posts
Next page »
Search
Go
This Blog
Home
About
Email
Tags
Design Guidelines
General API Design
General Programming
MEF
System.Collections
System.Diagnostics Tracing
Archives
September 2008 (1)
August 2008 (1)
July 2008 (3)
June 2008 (2)
April 2008 (4)
March 2008 (2)
January 2008 (2)
October 2007 (3)
July 2007 (3)
June 2007 (2)
May 2007 (1)
April 2007 (2)
March 2007 (1)
February 2007 (1)
January 2007 (2)
October 2006 (1)
August 2006 (2)
July 2006 (3)
June 2006 (1)
May 2006 (1)
March 2006 (3)
February 2006 (3)
December 2005 (3)
November 2005 (5)
October 2005 (1)
September 2005 (9)
August 2005 (2)
June 2005 (3)
May 2005 (4)
April 2005 (1)
March 2005 (2)
January 2005 (1)
November 2004 (4)
October 2004 (3)
September 2004 (2)
August 2004 (1)
June 2004 (2)
May 2004 (2)
April 2004 (1)
March 2004 (3)
Recommended Books
Framework Design Guidelines
The Laws of Simplicity
The Design of Everyday Things
Syndication
RSS 2.0
Atom 1.0