Sunday, November 29, 2009
Getting started with Managed Extensibility Framework (MEF)
Recently I got a chance to work with WordPress and Drupal, those are the coolest PHP based blogging and content management systems out there, while I was impressed with the simplified installation and configuration, one thing that struck me was how simple it is to add plugins to the system. For instance I wanted a photogallery, so I downloaded the plug-in from WordPress.com, unzipped, dropped it in the plugins folder, went to the Administration panel and there it was, the plug-in sitting right there ready to activate.
Fortunately .NET now gets its own plug-in architecture framework in the form of Managed Extensibility Framework or MEF.
MEF makes it really easy to build extensible .NET applications with just a few lines of code.
In the application that needs to be extended you define a common interface that your plugins can implement.
Then you make a collection where all the plugins are stored and mark it with Import or ImportMany attribute.
Then all you need to do is write your plug-in that implements the above IRule interface that you defined in your extensible application and mark it with Export attribute.
With that only a few lines of code is required to load the plug-in into your extensible application.
While this simple example is great for exploring MEF and building plug-in that live in the same assembly, in the real world scenario your plugins will be built as part of a different solution or a project, do check out some of the resources below that demonstrate in detail how to leverage MEF in your applications.
MEF on CodePlex – contains assemblies, source code and sample applications, do checkout the Silverlight grid sample.
The code sample shown above is taken from here, uses the Preview 8 drop of MEF on Codeplex
MEF on MSDN – covers MEF in detail including the scenario to load multiple plugins and other details.
Saturday, November 21, 2009
“Application Lifecycle Management in VS2010” session of TechiesUAE
I attended this session of TechiesUAE presented by Rolf Eleveld. First he took us through the installation and configuration steps required to run Team Foundation Server 2010 and Visual Studio 2010 beta 2.
Rolf then showed some of the new features in TFS 2010 version control and its integration with VS2010 including the web interface of TFS.
Also during the session, one of the interesting tool that he showed us is the new Problem Steps Recorder (or PSR) that ships with Windows 7.
This tool can help developers and IT Pros know the steps required to reproduce any problem to resolve it more quickly. For more info on it watch this video
During the session we also discussed the use of Entity Framework & Linq to Entities in the enterprise and also saw the demo of the interesting new Lab management capabilities introduced in VSTS 2010. This helps testers test the software in a virtual environment and raise any bugs, the developers can then launch the virtual machine from the IDE and find all the rich information along with the check point link included in the bug, for more info on this read this post on Soma’s blog.
The session lasted more than 3 hours.
Update. Dec 3,2009
Read Rolf's detailed notes from the event on the TechiesLeaders blog