Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Brandon Furtwangler

Brandon Furtwangler brandf

Niner since 2010

  • Silverlight TV Episode 5: Using Metadata with MEF

    I'm not suggesting you remove the imperative way to handle these more complicated cases.  I just seems like overkill for what I would imagine is the common case.

    It would be intersting to look at how Export Metadata is used in VS 2010 as a case study for how common these more complicated cases are.  My gut feeling is that equality comparison on a single piece of metadata (or AND'ed for multiple ImportMetadatas) is the common case.

    This would make it more pay-for-play...

  • Silverlight TV Episode 5: Using Metadata with MEF

    Why do you need to write any code at all to filter on metadata?  Why not have an 'ImportMetadataAttribute' that causes MEF to do the filtering for me?  The most common case is an 'equals' match against the metadata key/values, I would think there would be a simple way to do this without all this Lazy buisness..  Something like this:

    [Import]
    [ImportMetadata("IsSecure", true)]
    public IEmailSender Sender {get; set; }

     

    or

     

    [ImportMany]
    [ImportMetadata("IsSecure", true)]
    public IEnumerable<IEmailSender> Senders {get; set; }


    It would also be nice to say 'I only want one, and I dont care which one' using an 'ImportAnyAttribute'.