Sign In
Krzysztof Cwalina
Designing Reusable Frameworks
Translate This Page
Translate this page
Powered by
Microsoft® Translator
Tags
Design Guidelines
General API Design
General Programming
MEF
PLP
System.Collections
System.Diagnostics Tracing
Browse by Tags
MSDN Blogs
>
Krzysztof Cwalina
>
All Tags
>
system.collections
Tagged Content List
Blog Post:
Simulated Covariance for .NET Generics
Krzysztof Cwalina
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 constructed types don’t have a common...
on
2 Apr 2008
Blog Post:
Synchronization at the Right Level
Krzysztof Cwalina
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 data structure is rarely useful. Rico explains this...
on
5 May 2006
Blog Post:
C5 Collections
Krzysztof Cwalina
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 is that it allows for some powerful scenarios that...
on
20 Feb 2006
Blog Post:
Disposable Collection
Krzysztof Cwalina
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 one additional requirement that Dispose is called...
on
10 Feb 2006
Blog Post:
Immutable Collections
Krzysztof Cwalina
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 suggestion, but unfortunately not as easy as it...
on
22 Nov 2005
Blog Post:
Why we don’t recommend using List<T> in public APIs
Krzysztof Cwalina
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 notified when the collection is modified...
on
26 Sep 2005
Blog Post:
System.Collections vs. System.Collection.Generic and System.Collections.ObjectModel
Krzysztof Cwalina
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, size, and power. Use it for majority of internal...
on
23 Sep 2005
Blog Post:
List<T> vs. ArrayList Performance
Krzysztof Cwalina
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 :-)
on
25 Aug 2005
Blog Post:
PowerCollections Beta Avaliable
Krzysztof Cwalina
The beta release of the PowerCollections library has been posted today. See http://wintellect.com/WEBLOGS/pgolde/archive/2005/06/03/1304.aspx .
on
3 Jun 2005
Blog Post:
Generic interfaces, IsReadOnly, IsFixedSize, and array
Krzysztof Cwalina
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 thinking on this. We decided that there are really...
on
18 May 2005
Blog Post:
The reason why Collection
, ReadOnlyCollection
, and KeyedCollection
were moved to System.Collections.ObjectModel namespace
Krzysztof Cwalina
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 type called Collection. The namespace is...
on
15 Mar 2005
Blog Post:
The reason why IEnumerator
extens IDisposable
Krzysztof Cwalina
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 some connection or a handle, which then needs to...
on
7 Jan 2005
Blog Post:
Power Collections on GotDotNet Featured Sites
Krzysztof Cwalina
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 of advanced collection classes and algorithms...
on
3 Nov 2004
Blog Post:
IComaprer
& IComparable
Refactoring Proposal
Krzysztof Cwalina
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 looking for feedback on the proposal. Background...
on
27 Oct 2004
Blog Post:
System.Collections.Generic Dictionary
Capacity, Hashing, and Collisions.
Krzysztof Cwalina
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); The long answer...
on
6 Aug 2004
Blog Post:
Delegate-Based APIs
Krzysztof Cwalina
Generics and Anonymous Methods/Delegates make up a powerful pair that can be used to create elegant query APIs. Here are some that we just added to the .NET Framework’s Collection libraries. I used List<T> to illustrate the APIs but most of those were also added to System.Array. API...
on
22 Jun 2004
Page 1 of 1 (16 items)