Hlavní menu

Nástroje

UvodDoKomponent / MEFmore

View (print) - Edit page | Recent changes - Page history

Updated 28 January 2015, 14:10 by Eduard Chromik

UvodDoKomponent.MEFmore History

Hide minor edits - Show changes to output

28 January 2015, 14:10 by Eduard Chromik -
Changed lines 70-71 from:

to:
h2. Interestiong links
*[[Spring.NET & Attribute Driven Configuration -> http://the-tread-way.blogspot.cz/2010/04/springnet-attribute-driven.html]]
*[[MEF Runtime Plugin Swapping -> http://paxcel.net/blog/mef-runtime-plugin-swapping/]]

h2. TODO

http://channel9.msdn.com/posts/NET-45-Oleg-Lvovitch-and-Kevin-Ransom-Managed-Extensibility-Framework-MEF-20
http://www.codeproject.com/Articles/376033/From-Zero-to-Proficient-with-MEF
http://www.codeproject.com/Articles/37579/Managed-Extensibility-Framework-Part
https://emcpadden.wordpress.com/2008/12/07/managed-extensibility-framework-and-others/

28 January 2015, 14:09 by Eduard Chromik -
Changed lines 46-71 from:
@]
to:
@]

h2. 6. Why to use MEF

[[10 reasons why to use MEF -> http://csharperimage.jeremylikness.com/2010/04/ten-reasons-to-use-managed.html]]

h2. 7. Good explanations

h3. Audio
*[[Audio: MEF with Glenn Block -> http://www.hanselminutes.com/148/mef-managed-extensibility-framework-with-glenn-block]] [@IoC@], DI vs MEF

h3. Code
*[[Code: Barbarian Meets MEF -> http://www.barbarianmeetscoding.com/blog/2012/08/14/barbarian-meets-mef-managed-extensiblity-framework/]]
*[[Code: Glenn Block - Building Composable Apps in .NET 4 with the Managed Extensibility Framework -> http://msdn.microsoft.com/en-us/magazine/ee291628.aspx]] Complete explanations of MEF capabilities
*[[Code: Complete MEF Programming Guide -> https://mef.codeplex.com/wikipage?title=Guide&referringTitle=Overview]]

h3. Video
*[[Video: MEF Oleg Lvovitch and Kevin Ransom -> http://channel9.msdn.com/posts/NET-45-Oleg-Lvovitch-and-Kevin-Ransom-Managed-Extensibility-Framework-MEF-20]] Introduction, MEF 2.0
*[[Video: MEF Jan Steberl CZ -> http://channel9.msdn.com/Blogs/JanSteberl/Managed-Extensibility-Framework]] Introduction MEF - CZ

h3. Presentation
*[[Presentation: Lecture by Nuno Cancelo -> http://www.slideshare.net/NunoCancelo/give-more-life-to-your-application-extending-it-with-mef]]
*[[Presentation: Lecture by Mohamed Meligy -> http://www.slideshare.net/Mohamed_Meligy/managed-extensibility-framework-mef]]


28 January 2015, 13:53 by Eduard Chromik -
Added lines 1-46:
h2. 5. MEF vs standard IoC Container
Nicely writen article about "Mef vs IoC"
[[here -> http://msdn.microsoft.com/en-us/magazine/gg650670.aspx]].

DI is based on three dimensions, Object Composition, Lifetime Management, and Interception.
MEF has potential, but as a DI container, it lacks:
*Code as Configuration
*Auto Registration
*XML configuration
*Custom Lifetimes
*[[Interception -> http://msdn.microsoft.com/en-us/magazine/gg535676.aspx]] (another example [[Interception using Dependency Injection Container -> http://www.freeportmetrics.com/blog/interception-using-dependency-injection-container-unity-to-achieve-separation-of-concerns/]])


For Lifestyle it lacks:
*Per graph
*Web Request Context
*Thread Context
*Session Context
*Pooled
*Scoped
*Custom Reference

Its a option to use MEF as a Extension for standard IoC container [[more -> http://blogs.msdn.com/b/nblumhardt/archive/2009/03/16/hosting-mef-extensions-in-an-ioc-container.aspx]].

h3. .NET IoC/DI options:
*[[Containers comparsion-> http://featuretests.apphb.com/DependencyInjection.html]] (another [[Unity, StructurMap, Autofac, Castle Windsor, Ninject facilitates and Spring.NET comparsion -> http://elegantcode.com/2009/01/07/ioc-libraries-compared/]])
*[[OSGi.net -> http://osgi.codeplex.com]]


h2. 5. MEF Visualizer
Helps to see what is going on inside the MEF Composition Container. [[Download -> http://mefvisualizer.codeplex.com]]
%width=700px%Attach:MEF_Visualization.png

->[@
Container = new CompositionContainer(
new AggregateCatalog(
new AssemblyCatalog( Assembly.GetExecutingAssembly() ) ,
new AssemblyCatalog( Assembly.LoadFrom( @"MEFVisualizer.Exe" ) )
) );

Container.Compose( batch );

var meftoDgml = new MEFToDGML( Container){ IsNamespaceGrouping = true }; // The Visualizer

meftoDgml.WriteToDGMLFile(); // Write to DGML file
@]