Way of MEF slides and Code


image

Thanks to everyone who came out to the “Way of MEF” education day in Cupertino. I had a great time and you were an awesome audience. I really appreciate all the great / in-depth questions. It showed that you really were keeping along. I also enjoyed all the different side conversations, and all the times you guys overwhelmed me at the breaks. I really do love this stuff!

Here is a link to get you access to the code and the slides: http://cid-f8b2fd72406fb218.office.live.com/browse.aspx/Public/Way%20of%20MEF

If you download the code it contains the following:

  • HelloMef_Simple – The simple widget example we built
  • HelloMef_Extended – Sample that downloads multiple XAPs and which demonstrates ExportFactory.
  • MefRules_Simple – The simple rules engine we built on the fly
  • MefRules_Extended – More complete rules engine sample which uses rule metadata and contains a runner for Silverlight and Desktop.
  • DynamicObjectContracts – Demonstrates a simple illustration of using dynamic exports and imports
  • PartUpdatesInPlace – Demonstrates uses shadow copying to allow hot swapping / removing parts on the fly. (the one that the audience asked me about)

Here are additional links:

Finally as promised, if you have questions that were not answered in the talk, feel free to comment here or email me direct and I will answer them in a follow up post.

Thanks to Mathias Brandewinder, Kevin Rohling, his nutty girlfriend and recruiter extraordinaire Megan Hopkins and the Bay.NET UG for hosting me. I had an awesome time.

Yes, I know I need to post on what I am working on now……I hear you, pleae be patient 🙂

Comments (3)

  1. Abhishek Das says:

    Hi Glenn,

    I attended "Way to MEF" yesterday. It was very good and interesring one.

    But I am getting an exception while running  RuleEngine example. I thought I missed something , so i was waiting for code sample to be available. After downloading the sample from the given link, I am still getting the same error.

    The exception is

    No valid exports were found that match the constraint '((exportDefinition.ContractName == "RulesEngine.Contracts.IRulesEngine") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "RulesEngine.Contracts.IRulesEngine".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))', invalid exports may have been rejected.

    I think I am missing something.. Can you please help me out..

  2. Abhishek Das says:

    Hi Glenn,

    I attended "Way to MEF" yesterday. It was very good and interesring one.

    But I am getting an exception while running  RuleEngine example. I thought I missed something , so i was waiting for code sample to be available. After downloading it from the given link, I am still getting the same error.

    The exception is

    No valid exports were found that match the constraint '((exportDefinition.ContractName == "RulesEngine.Contracts.IRulesEngine") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "RulesEngine.Contracts.IRulesEngine".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))', invalid exports may have been rejected.

    I think I am missing something.. Can you please help me out..

  3. Hi Glen,

    This  presentation got me thinking about using MEF in a Silverlight application I'm working on, and a comment you made on someone else's blog got me thinking about implementation.

    If you're using a Silverlight Navigation project and create multiple projects/XAP files for different sections of the application, then what's wanted is a WCF service that looks at the XAP files on the host and reports back on what's in them so the client doesn't have to download the XAP files they don't need (until they click on the hyperlink).  I see lots of samples on interrogating the XAP file on the client, but none on the host (since the classes are in System.Windows.Resources).  Any thoughts?