Posts

Showing posts from June, 2014

New experimental collections - MultiDictionary

Immo Landwerth posted an interesting article here on the concept of a MultiDictionary. I know it's something I've implemented myself on many occasion and here is his contribution, available via NuGet.

An excerpt from the article at http://blogs.msdn.com/b/dotnet/archive/2014/06/20/would-you-like-a-multidictionary.aspx:
What’s your favorite data structure? Mine is the dictionary; I love the near constant time operations, the huge number of use cases, the cleanliness! Although the dictionary has a wide variety of uses, there are times when I want to add multiple values per key and Dictionary just doesn’t quite cut it. In those situations the solution is simple: just build aDictionary>!The issue with the dictionary of list is nearly every call to the Dictionary has to be wrapped in logic to check the current state of the dictionary before adding/removing/indexing etc. I’m never satisfied with the idea of surrounding my dictionary calls with a series of if statements, so I end …