Glenn Block

Sponsors

The Lounge

News

  • View Glenn Block's profile on LinkedIn

    Me

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
MEF Re-factored, Preview 3 has shipped.

We just dropped another release of MEF source. This one includes some significant changes that we're excited about.

1. We're now completely MS-PL!!! The StructuredValues dll dependency is now removed. You're free to use the source how you like on Windows and beyond.

2. Container re-factoring - We've done an overhaul of the composition container. Outwardly this slightly affects the public API, internally it makes our design cleaner, and easier to extend. I'll discuss more details on this in my next post, but the diagram below shows the changes. What should be apparent is that we've reduced greatly the bi-directional tight coupling :-( between the various components. (all the wacky lines)

Before:

image_thumb20

After:

image_thumb24

3. ExportProvider - We've replaced the Value Resolver with a new Export Provider. Export Providers are easier to author, and can be used for integrating with external systems. Export Providers can be chained together through using a new AggregatingExportProvider. This allows you to apply custom policies to the container for how exports are discovered.

4. Defaults - The new AggregatingExportProvider is prioritized with Export Provider's at the top of the chain having higher priority over those at the back. This means you can have defaults such as a default logger which are overridable. These defaults take on a secondary role, which is they allow you to have single imports (like importing a single logger) succeed even if multiple loggers are present. Supporting default behavior is something that the community has been requested repeatedly.

5. Catalog Cache - The catalog now builds a persistent cache of all the metadata for parts in the catalog. Until the part is instantiated, it's assembly will not get loaded. For lazy loading this means if a part imports an Export<IFoo>  then the Foo  assembly will not be loaded until GetExportedObject is called.

6. Performance tweaks - We've done a bunch of significant perf enhancements to the container / composition.

7. Unit Tests - We heard you loud and clear that you wanted to see them, well now we've included our full suite of unit tests.

As I mentioned above, I'll be doing some follow up posts to talk about the changes in detail.

You can get the bits here.


Posted 11-25-2008 4:06 PM by Glenn Block
Filed under:

[Advertisement]

Comments

Sidar Ok wrote re: MEF Re-factored, Preview 3 has shipped.
on 11-25-2008 8:15 PM

Congratulations ! I am especially happy to see the tests.

Bryan Watts wrote re: MEF Re-factored, Preview 3 has shipped.
on 11-25-2008 11:42 PM

Great! Congrats on the release.

So many times you see frameworks violating the very rules they are in place to facilitate, i.e. composition engines not being very decoupled.

Looking forward to learning about the new concepts!

Brad Abrams wrote MEF Preview 3 Shipped!
on 11-25-2008 11:55 PM

I am pretty excited to see MEF preview 3 ship on codeplex today!&#160; Please check out Glenn's post

Reflective Perspective - Chris Alcock » The Morning Brew #231 wrote Reflective Perspective - Chris Alcock &raquo; The Morning Brew #231
on 11-26-2008 3:33 AM

Pingback from  Reflective Perspective - Chris Alcock  &raquo; The Morning Brew #231

2008 November 26 - Links for today « My (almost) Daily Links wrote 2008 November 26 - Links for today &laquo; My (almost) Daily Links
on 11-26-2008 4:02 AM

Pingback from  2008 November 26 - Links for today &laquo; My (almost) Daily Links

Kyle Szklenski wrote re: MEF Re-factored, Preview 3 has shipped.
on 11-26-2008 10:12 AM

You used the older version in the DNR TV from Oredev, right? It looks more like it, although it's hard to tell since what you did was fairly simple.

I really like this, anyway. I'm going to start playing around with implementing a nice business rules engine that imports its rules on the fly - so that a person can provide an assembly that adds to the list of rules. I've already implemented the engine, actually - now I just need to put in the MEF, which I wish I could have thought of first. Oh well.

scott fluto wrote re: MEF Re-factored, Preview 3 has shipped.
on 11-27-2008 2:21 PM

Do you know if this compiles under mono also and is licensed to be run under mono since our application runs under windows and mono?

Glenn Block wrote re: MEF Re-factored, Preview 3 has shipped.
on 11-27-2008 2:35 PM

Scott

Licensing is no issue as MS-PL has no platform restriction. In terms of compiling under mono, we haven't tried it. The one thing MEF depends on is LINQ. I spoke to Miguel De Icaza and he said Mono 2.0 supports LINQ. So....you can surely try it. Let us know if it works :)

We actually have chatted with Miguel about mono guys using it.

Glenn Block wrote re: MEF Re-factored, Preview 3 has shipped.
on 11-27-2008 2:36 PM

@Kyle

It was the earlier bits. Not any major difference it what was shown except that in the demo I call CreateResolver() when I pass the catalog to the contianer. You won't do that anymore.

custom built systems | NBA.COM wrote custom built systems | NBA.COM
on 11-27-2008 4:10 PM

Pingback from  custom built systems | NBA.COM

Bnaya Eshet wrote re: MEF Re-factored, Preview 3 has shipped.
on 11-29-2008 12:04 AM

Congratulations :-)

Сергей Лутай wrote Вышел MEF Preview 3
on 11-29-2008 6:42 AM

Данный preview с MS-PL лицензией. Его изменения: Сделан рефактор Composition Container'а. Новая реализация

MEF « Tales from a Trading Desk wrote MEF &laquo; Tales from a Trading Desk
on 12-24-2008 3:57 PM

Pingback from  MEF &laquo; Tales from a Trading Desk

Add a Comment

(required)  
(optional)
(required)  
Remember Me?