is MEF still a thing?

334 views
Skip to first unread message

Josh Santangelo

unread,
Mar 7, 2013, 7:26:27 PM3/7/13
to wpf-disciples
I'm working on a Windows Store XAML app which will have a bunch of pre-defined visual regions, and a bunch of various modules which can be loaded into each, configurable by the user. I haven't looked at MEF in ages -- it seems like it's designed for this sort of thing, but is it still considered best practice? The Codeplex site seems to be gathering cobwebs and the only relevant code sample seems to have vanished.

My use case isn't any more complex than described so I could probably roll my own thing, but this seemed like an opportunity to learn something new. How would you do it?

thanks,
-josh

Peter O'Hanlon

unread,
Mar 7, 2013, 7:29:09 PM3/7/13
to WPF Disciples
It certainly is - it's not quite as fully featured, but it's still there. http://mef.codeplex.com/wikipage?title=MetroChanges&referringTitle=Documentation



--
 
---
You received this message because you are subscribed to the Google Groups "XAML Disciples" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wpf-disciple...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Peter O'Hanlon

Josh Santangelo

unread,
Mar 7, 2013, 7:35:08 PM3/7/13
to wpf-disciples
I found that, but I'm really looking for is a code sample that's vaguely similar to what I'm trying to achieve...

Colin Blair

unread,
Mar 11, 2013, 1:59:57 PM3/11/13
to wpf-di...@googlegroups.com

What you are describing sounds more like what Prism was providing in WPF/Silverlight. The Windows Store version of Prism is called Kona but it looks like they have decided to move away from what you are asking for. http://konaguidance.codeplex.com/

--

Brian Noyes

unread,
Mar 11, 2013, 4:01:54 PM3/11/13
to wpf-di...@googlegroups.com
I can answer any questions on Kona, I was part of both the Prism and Kona teams as a vendor to Microsoft. Just released part 2 of an article series on Kona here: http://www.silverlightshow.net/items/Windows-Store-LOB-Apps-with-Kona-Commands-Dependencies-and-Navigation.aspx and am working on a Pluralisight course on it.

We specifically did not include what Josh was originally alluding to - which were called "Regions" in Prism because they were put in Prism mainly for extensibility reasons - they went hand in hand with Modularity, which was the idea that you could just "drop in" a new module, and it could plug its views into a region and that new functionality could light up with no changes to the shell. That general scenario doesn't make as much sense for Windows Store apps because of the need to deploy a signed app package that can't dynamically load other code at runtime.

So in Kona we took the approach that you can achieve the same thing with hierarchical view models - i.e. have a child view model or a collection of child view models exposed as a property on a parent view model, and as long as that property is based on a common abstraction (i.e. a ViewModel base class), you can compose or "plug in" additional child views in maintenance from version to version just by modifying how that property gets populated. Combined with something like MEF or any container really, that means you can then still plug in child views into a "region" or container without the containing view model knowing explicitly about all its children if you want that degree of decoupling.

From having conversations with a PM on the MEF team, they specifically only targeted dynamic composition scenarios for the MEF for WinRT version (as opposed to true extensibility - plugging in unknown dependencies at runtime) for the same reason we cut regions from our scope on Kona - you can't really do it with the app packaging model of Windows Store apps.

Brian

Colin Blair

unread,
Mar 11, 2013, 5:20:44 PM3/11/13
to wpf-di...@googlegroups.com

Thanks for the explanation Brian, that would make for a good blog post. Right now the only thing that I can bingle  is http://www.programmingtidbits.com/post/2013/01/14/Kona-Windows-8-LOB-Apps-Design-Guidelines.aspx and I don’t think it makes a good argument.

 

I do like the Kona example app, I have been using it as a guide while architecting the Open RIA Services support for Windows Store applications.

Michael Brown

unread,
May 3, 2013, 8:14:32 PM5/3/13
to wpf-di...@googlegroups.com

I remember there being an MEF code sample for WinRT. I think the application was showing how to use the Azure Service Bus from WinRT. A quick search turned up this article.

Reply all
Reply to author
Forward
0 new messages