SlideShare a Scribd company logo
MEFilicious Applications
              Owen Evans
            Developer - Xero
       @buildmaster http://bgeek.net
What is MEF

• Managed Extensibility Framework
 • Standards for exposing yourself!
 • Open/Closed principal
 • It’s all so META
MEFilicious Applications
MEFilicious Applications
MEFilicious Applications
ComposablePart

• The building block of a MEF enabled
  application
 • Defines an [Import] or [Export] (or
    both)
Catalog - a collection of
         parts
• Catalogs are how you define which parts
  are available to the system
 • Directory Catalog
 • Assembly Catalog
 • Aggregate Catalog
CompositionContainer


• Similar to an IoC container
• Wires everything together and satisfies
  dependancies
demo time...
  MEF 101
MEF steps
• Create a catalog (or collection of catalogs)
  var
catalog
=
new
AggregateCatalog(new
DirectoryCatalog(@"."),new

  AssemblyCatalog(Assembly.GetExecutingAssembly()));




• Add catalog(s) to container
  var
container
=
new
CompositionContainer(catalog);




• Get a type from the container
  var
window
=
container.GetExportedValue<CashMaker>();
Filtering

• Catalogs can be filtered down using a
  FilteredCatalog*
  (* source code available here: http://bit.ly/
  MEFFilter)
demo time...
Filtered Catalog
Recomposition

• Import points can be marked as
  recomposable
 • New instances in the catalog matching
    the import will cause the collection to be
    rebuilt
demo time...
Recomposition
Lifetime
• Export providers can decide on the lifetime
  of their parts:
  • Shared: only one instance per container
  • NonShared: each export will create a
    new instance
  • Any: allows any use (can be defined on
    import)
demo time...
Creation Policy
Thats all there is to
        MEF
MEF is:

• A framework for creating extensible
  applications
• Puts focus on discovery of parts at run
  time

• as such...
MEF is not
•   IoC
    •   Inversion of Control is about knowing what
        dependancies satisfy given classes and allowing the
        class to hand this requirement off
    •   IoC containers are great at saying => “When asking
        for an IDependancy you should get Dependancy”
    •   MEF doesn’t have a way of doing this
    •   MEF says I have all these objects and you want
        some of them... HERE.
Did I say I’m running a Web Dev Conference?
               http://wdcnz.com

More Related Content

PDF
Locks, Blocks, and Snapshots: Maximizing Database Concurrency (PASSDC User Gr...
Bob Pusateri
 
PDF
Locks, Blocks, and Snapshots: Maximizing Database Concurrency (PASS DBA Virtu...
Bob Pusateri
 
PPTX
Introduction to Dependency Injection
SolTech, Inc.
 
PPTX
Javascript Road Trip(es6)
Ahmed Assaf
 
PPTX
Extensibility in application
Abhishek Sur
 
PPTX
Building extensible application using MEF
Ronak Thakkar
 
PPT
Extending the Enterprise with MEF
Brian Ritchie
 
PPTX
Managed Extensibility Framework or Effective Development of Scalable Applicat...
SoftServe
 
Locks, Blocks, and Snapshots: Maximizing Database Concurrency (PASSDC User Gr...
Bob Pusateri
 
Locks, Blocks, and Snapshots: Maximizing Database Concurrency (PASS DBA Virtu...
Bob Pusateri
 
Introduction to Dependency Injection
SolTech, Inc.
 
Javascript Road Trip(es6)
Ahmed Assaf
 
Extensibility in application
Abhishek Sur
 
Building extensible application using MEF
Ronak Thakkar
 
Extending the Enterprise with MEF
Brian Ritchie
 
Managed Extensibility Framework or Effective Development of Scalable Applicat...
SoftServe
 

Similar to MEFilicious Applications (20)

PDF
Managed Extensibility Framework
Volodymyr Voytyshyn
 
PPTX
Creating extendable applications using MEF
Ben Hall
 
PPT
Mef 12 step program
JamesEggers
 
PPTX
Microsoft Managed Extensibility Framework
Binu Bhasuran
 
PPTX
When MEF meets Silverlight
Amr Elsehemy
 
DOCX
The managed extensibility framework
SpencersSlides
 
PPT
Managed Extensibility Framework (MEF)
Mohamed Meligy
 
PPTX
MEF in Silverlight 4 - a guided tour
mark mann
 
PPTX
Mef - NxtGenUG Coventry
Ben Hall
 
PPTX
Creating extensible application using MEF
Ben Hall
 
PPTX
MEF
Yuriy Seniuk
 
PPTX
Open.up.your.applications.with.MEF
guestcb74eee
 
PPTX
Introduction to the Managed Extensibility Framework in Silverlight
Jeremy Likness
 
PPTX
MEF Deep Dive by Piotr Wlodek
infusiondev
 
PDF
Mike Taulty DevDays 2010 Silverlight MEF
ukdpe
 
PPTX
Fun with ASP.NET MVC 3, MEF and NuGet (#comdaybe)
Maarten Balliauw
 
PPTX
Diagnosing MEF Failure
James Counts
 
PPTX
Building Extensible RIAs with MEF
Glenn Block
 
PPTX
WPF and Prism 4.1 Workshop at BASTA Austria
Rainer Stropek
 
PPTX
Fun with ASP.NET MVC 3, MEF and NuGet
Maarten Balliauw
 
Managed Extensibility Framework
Volodymyr Voytyshyn
 
Creating extendable applications using MEF
Ben Hall
 
Mef 12 step program
JamesEggers
 
Microsoft Managed Extensibility Framework
Binu Bhasuran
 
When MEF meets Silverlight
Amr Elsehemy
 
The managed extensibility framework
SpencersSlides
 
Managed Extensibility Framework (MEF)
Mohamed Meligy
 
MEF in Silverlight 4 - a guided tour
mark mann
 
Mef - NxtGenUG Coventry
Ben Hall
 
Creating extensible application using MEF
Ben Hall
 
Open.up.your.applications.with.MEF
guestcb74eee
 
Introduction to the Managed Extensibility Framework in Silverlight
Jeremy Likness
 
MEF Deep Dive by Piotr Wlodek
infusiondev
 
Mike Taulty DevDays 2010 Silverlight MEF
ukdpe
 
Fun with ASP.NET MVC 3, MEF and NuGet (#comdaybe)
Maarten Balliauw
 
Diagnosing MEF Failure
James Counts
 
Building Extensible RIAs with MEF
Glenn Block
 
WPF and Prism 4.1 Workshop at BASTA Austria
Rainer Stropek
 
Fun with ASP.NET MVC 3, MEF and NuGet
Maarten Balliauw
 
Ad

More from buildmaster (7)

PDF
DevOps is Dead. Long live devops
buildmaster
 
PDF
API Days: For the Love of Small
buildmaster
 
KEY
Bahaviour Driven Development
buildmaster
 
KEY
Linq Refresher
buildmaster
 
PPT
Oslo
buildmaster
 
PPT
ASP.net MVC CodeCamp Presentation
buildmaster
 
PPT
Mocking 101
buildmaster
 
DevOps is Dead. Long live devops
buildmaster
 
API Days: For the Love of Small
buildmaster
 
Bahaviour Driven Development
buildmaster
 
Linq Refresher
buildmaster
 
ASP.net MVC CodeCamp Presentation
buildmaster
 
Mocking 101
buildmaster
 
Ad

Recently uploaded (20)

PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
Doc9.....................................
SofiaCollazos
 
PPTX
The Future of AI & Machine Learning.pptx
pritsen4700
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PPTX
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
Doc9.....................................
SofiaCollazos
 
The Future of AI & Machine Learning.pptx
pritsen4700
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
The Future of Artificial Intelligence (AI)
Mukul
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 

MEFilicious Applications

  • 1. MEFilicious Applications Owen Evans Developer - Xero @buildmaster http://bgeek.net
  • 2. What is MEF • Managed Extensibility Framework • Standards for exposing yourself! • Open/Closed principal • It’s all so META
  • 6. ComposablePart • The building block of a MEF enabled application • Defines an [Import] or [Export] (or both)
  • 7. Catalog - a collection of parts • Catalogs are how you define which parts are available to the system • Directory Catalog • Assembly Catalog • Aggregate Catalog
  • 8. CompositionContainer • Similar to an IoC container • Wires everything together and satisfies dependancies
  • 9. demo time... MEF 101
  • 10. MEF steps • Create a catalog (or collection of catalogs) var
catalog
=
new
AggregateCatalog(new
DirectoryCatalog(@"."),new
 AssemblyCatalog(Assembly.GetExecutingAssembly())); • Add catalog(s) to container var
container
=
new
CompositionContainer(catalog); • Get a type from the container var
window
=
container.GetExportedValue<CashMaker>();
  • 11. Filtering • Catalogs can be filtered down using a FilteredCatalog* (* source code available here: http://bit.ly/ MEFFilter)
  • 13. Recomposition • Import points can be marked as recomposable • New instances in the catalog matching the import will cause the collection to be rebuilt
  • 15. Lifetime • Export providers can decide on the lifetime of their parts: • Shared: only one instance per container • NonShared: each export will create a new instance • Any: allows any use (can be defined on import)
  • 17. Thats all there is to MEF
  • 18. MEF is: • A framework for creating extensible applications • Puts focus on discovery of parts at run time • as such...
  • 19. MEF is not • IoC • Inversion of Control is about knowing what dependancies satisfy given classes and allowing the class to hand this requirement off • IoC containers are great at saying => “When asking for an IDependancy you should get Dependancy” • MEF doesn’t have a way of doing this • MEF says I have all these objects and you want some of them... HERE.
  • 20. Did I say I’m running a Web Dev Conference? http://wdcnz.com

Editor's Notes