Have you ever wanted to dynamically choose from many potential implementations of some code? Would you like to have the power of metadata filtering and lazy instantiation of the selected implementation? Here is how to do just that using Managed Extensibility Framework (MEF) and also a neat trick to handle your implementation/metadata pairs that I [...]
Handling Lazy + Metadata instances in Managed Extensibility Framework (MEF)
August 4th, 2010 by Magnus Mårtensson — .Net, Architecture, Tips & Tricks
Tags: .Net, .NET Framework, tips
Performance nightmare
March 5th, 2010 by Björn Carlsson — .Net, Tips & Tricks
22 to 0.3 seconds! I found a simple solution to a very common problem. While profiling I found that remove in this little method took a lot of the time. public void MovePropertyFirst(IProperty property) { properties.Remove(property); properties.Insert(0, property); } The reason was, that it’s time consuming to compare the properties by equality, for complex types. [...]
Tags: .Net, .NET Framework, performance, programming, windows
