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 is that it allows for some powerful scenarios that are not possible if you simply build on top of the existing abstractions (riches compile time checking). The drawback is that it might not integrate with code that uses the standard abstractions as seamlessly as the Power Collections.

These two libraries represent two distinct philosophies of extending the Framework/CLI. They make different tradeoffs between the degree of innovation and interoperability. If you have used any of these libraries, I would appreciate you comments on how these philosophies work in practice and in general you observations on using 3rd party libraries. Do they integrate well with the Framework? How are they in terms of usability? Do they provide support for main functionality you are/were missing in the Framework?

Comments (5)
  1. James Savarino says:

    I have incorporated Wintellect’s PowerCollections into a complex model that simulates the impact of applying alternative screening modalities on observed colorectal cancer.  I found the "ordered collections" very useful.  The functionality that I have foud most useful is the functionality provided by the static methods of the Algorithm’s class that allow one to combine and filter lists of data

    Jim Savarino

    Group Health Cooperative

    Seattle WA

  2. I do not like the base interfaces in .NET, especially the way read-only collections are handled, but I do think it is possible to implement them privately and offer a richer model publicly, having the best of both world.

    The C5 collections are over-engineered in my opinion. Also, I think they lack clear separation of concepts (eg. IPersistenceSorted -> ISorted … why merge persistence and sort ?) and the semantic of many interface methods and properties change significantly depending on the type implementing them (item vs bag of items).

    I really like the Algorithm class of PowerCollections. That alone is a gem in itself. Also, I am need to look more thoroughly at the C5 collections, but I know for a fact that PowerCollections are really performant.

    On a side note, I saw that System.Data has a generic RedBlackTree class. How about making it public in System.Collections.Generic ?

  3. Josh Mouch says:

    I am just starting to test each of these two, and I already have two big problems with PowerCollections.  The first is that everything is sealed.  It’s almost funny to me that the only libraries that I ever see sealed are ones that are created by Microsoft.  The second is that there are no events in the collections.  Ironically, in order to add that functionality, you would need to go through the source code and remove all of the seals. 😉

    So, I am going to try using C5.  I’ll let you know how it goes.

  4. Josh, Microsoft did not create PowerCollections. But thanks for the feedback on sealing. Our Design Guidelines recommend that types are not sealed unless there is a good reason to. If you see a Framework API that does not follow the guideline. I would be interested in hearing about it.

Comments are closed.

Skip to main content