Posted By: Mike Taulty | Dec 31st, 2009 @ 2:27 AM | 41,793 Views | 14 Comments

Part 2 of a series of screencasts looking at the new Managed Extensibility Framework (MEF) in the Silverlight 4 beta.

MEF is a framework that simplifies the design of extensible applications and components. It can flexibly and dynamically discover a set of loosely coupled components and analyse their dependencies in order to compose them together at run time.

In this screencast, we take a deeper look around using the MEF attributed programming model. We look at what we can import & export, required and optional imports, cardinality, creation policies and also how we can add our own metadata for differentiation.

Tips for viewing:

  • Each video in this series has a 3.5 minute standard introductory "header" on it so once you have seen that header you may like to skip it on subsequent videos
  • For the time pressured - I find that I speak so slowly that you can speed me up to approximately 1.5-2.0 times normal speed and still listen comfortably.

I'm working to get together a Live Meeting in early 2010 with people from the MEF team in order that people can chat more about MEF in Silverlight. Stay tuned.

The next screencast in this series is here.

Rating:
3
0
samcov
samcov
Which pill did I take?

This was a great refresher for me, however, if I hadn't been playing with MEF for awhile, I can't see how a someone new to MEF could possibly follow this.

Mike I would have to disagree with Sam on this.   Your video tutorials are fantastic and perfect to get a real understanding of what MEF can provide.   I can only point to a hand full of video tutorials that are of this cabiler; yours is top notch!

 

Thank you very much for these!

Hey Mike,

 

Excellent stuff as usual. Apart from looking at part one, I haven't looked at MEF at all and I was able to follow it no problem.  If the problem is lack of background, then there are better places to get the in depth theory of why MEF is useful than here. For me, it's perfect pace and content. Loving it.

 

Whirly.

samcov
samcov
Which pill did I take?

I think you missed my point, it worked GREAT for me, but if I had seen this when I knew nothing about MEF, I don't think it would have been as effective.

 

I reference the pace with which you presented Unity.  I had never used or looked into Unity, and I got it clear and clean.

 

I have to admit, this is total opinion because I can't unlearn what I already knew about MEF, so the better judge would be someone fresh to the subject.

 

@Mike Kidder - While you may disagree, you provided no basis for that disagreement.  The only possible metric would be that you knew nothing about MEF, and got a good grasp of it here.  If that was the case, you should have stated it, and if that is the case, you would be the person with the superior view of the way it was presented.

 

@Whirily - Perhaps if you re-read my post you might have a better understanding of what I said.  Your assumption is totally off.

 

Too bad there wasn't a test at the end of the video, lol.

@Mike,

 

I really liked these videos.  It is probably the most detailed MEF video/intro that is out there.

 

MEF is not for beginers and it should be noted as an "advanced" topic.  Devs who are not familiar with attributes, interfaces, lazy loading patterns, Silverlight app structure and to some extent Visual Studio 2010 are simply going to be scratching their heads after the first few minutes.

 

The only feedback I would give is to possibly the source code for each video (as you state, you change the code from video to video in some cases) and if someone created a lab for this that would be great as well.

 

The next evolution of MEF needs to be some "best practice" guidance from Microsoft on using MEF.

Hi guys,

 

I'm brand new to MEF and just saw these first two videos.

 

First, Mike - awesome videos - I agree with everyone else here, yours is an example for all other tutorials on channel9 to follow!

 

Second, in response to the comments about whether a noob could follow this at all: I am definitely a noob to MEF, having never heard of it until I came across these videos. However, I'm not a junior developer at all, and I also have a good deal of experience with other Dependency Injection / Container frameworks. Currently in my projects I'm using Autofaq.

 

So, I've had no trouble following any of the concepts presented so far, even though its the first time I'm seeing MEF, and I've also just barely scratched the surface of Silverlight and VS2010 also. As I'm watching, I'm comparing to Autofaq and other frameworks to get a sense of how MEF offers similar features.

 

But I would agree, anyone completely new to both MEF and DI/IOC would probably be a bit lost, not because MEF is particularly hard to use (it's not) but because DI/IOC are pretty tough for developers to get to grips with at first, and there's really no easy way to just "dive right in" with someone who is still thinking in terms of passing dependencies around.

 

So far I really like what I see, but admittedly the controversy is going to come out as we get to the more advanced concepts. Looking forward to continuing on though, and I'm already considering how I could go about ripping out Autofaq and replacing it with MEF in my current project.

 

I do have one question though: watching these videos, and also reading through some of the content on the MEF homepage, I don't really see any mention of DI/IOC as concepts, and while most DI frameworks seem to use more or less the same terminology (Containers, Singletons, Prototypes, etc.), MEF seems to have invented a completely new set of terminology for what appear to be all the same concepts. I am still new to this, but so far my conclusion is that either (1) the developers of MEF have no idea that they are reinventing the wheel (but potentially much better); or (2) this is the intention, but all of the theoretical stuff has been purposefully left out in the videos and in the content, to avoid further confusing noobs; or (3) I'm completely misunderstanding things, and MEF is not intended to have anything to do with DI/IOC? Please enlighten me!

 

Thanks!

 

Microsoft Communities