SlideShare a Scribd company logo
1 of 20
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
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

Similar to MEFilicious Applications

Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
seleniumconf
 
WebObjects Developer Tools
WebObjects Developer ToolsWebObjects Developer Tools
WebObjects Developer Tools
WO Community
 
A begineers guide of JAVA - Getting Started
 A begineers guide of JAVA - Getting Started A begineers guide of JAVA - Getting Started
A begineers guide of JAVA - Getting Started
Rakesh Madugula
 

Similar to MEFilicious Applications (20)

Selenium Training in Chennai
Selenium Training in ChennaiSelenium Training in Chennai
Selenium Training in Chennai
 
Writing Well Abstracted Automation on Foundations of Jello
Writing Well Abstracted Automation on Foundations of JelloWriting Well Abstracted Automation on Foundations of Jello
Writing Well Abstracted Automation on Foundations of Jello
 
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
 
Testing Flex RIAs for NJ Flex user group
Testing Flex RIAs for NJ Flex user groupTesting Flex RIAs for NJ Flex user group
Testing Flex RIAs for NJ Flex user group
 
The Meteor Framework
The Meteor FrameworkThe Meteor Framework
The Meteor Framework
 
WebObjects Developer Tools
WebObjects Developer ToolsWebObjects Developer Tools
WebObjects Developer Tools
 
Laravel ppt
Laravel pptLaravel ppt
Laravel ppt
 
The Latest in Enterprise JavaBeans Technology
The Latest in Enterprise JavaBeans TechnologyThe Latest in Enterprise JavaBeans Technology
The Latest in Enterprise JavaBeans Technology
 
DevOps with Elastic Beanstalk - TCCC-2014
DevOps with Elastic Beanstalk - TCCC-2014DevOps with Elastic Beanstalk - TCCC-2014
DevOps with Elastic Beanstalk - TCCC-2014
 
Tools for Managing your LabVIEW Source Code
Tools for Managing your LabVIEW Source CodeTools for Managing your LabVIEW Source Code
Tools for Managing your LabVIEW Source Code
 
Skillwise Elementary Java Programming
Skillwise Elementary Java ProgrammingSkillwise Elementary Java Programming
Skillwise Elementary Java Programming
 
ics user group dev day_2014 use notes objects in memory and other useful
ics user group dev day_2014 use notes objects in memory and other usefulics user group dev day_2014 use notes objects in memory and other useful
ics user group dev day_2014 use notes objects in memory and other useful
 
Eclipse plug in development
Eclipse plug in developmentEclipse plug in development
Eclipse plug in development
 
In
InIn
In
 
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
 
A begineers guide of JAVA - Getting Started
 A begineers guide of JAVA - Getting Started A begineers guide of JAVA - Getting Started
A begineers guide of JAVA - Getting Started
 
Ch4 ejb
Ch4 ejbCh4 ejb
Ch4 ejb
 
eCAP Developer Walkthru
eCAP Developer WalkthrueCAP Developer Walkthru
eCAP Developer Walkthru
 
BP-5 Application Lifecycle Management
BP-5 Application Lifecycle ManagementBP-5 Application Lifecycle Management
BP-5 Application Lifecycle Management
 
Beyond Domino Designer
Beyond Domino DesignerBeyond Domino Designer
Beyond Domino Designer
 

More from buildmaster (7)

DevOps is Dead. Long live devops
DevOps is Dead. Long live devopsDevOps is Dead. Long live devops
DevOps is Dead. Long live devops
 
API Days: For the Love of Small
API Days: For the Love of SmallAPI Days: For the Love of Small
API Days: For the Love of Small
 
Bahaviour Driven Development
Bahaviour Driven DevelopmentBahaviour Driven Development
Bahaviour Driven Development
 
Linq Refresher
Linq RefresherLinq Refresher
Linq Refresher
 
Oslo
OsloOslo
Oslo
 
ASP.net MVC CodeCamp Presentation
ASP.net MVC CodeCamp PresentationASP.net MVC CodeCamp Presentation
ASP.net MVC CodeCamp Presentation
 
Mocking 101
Mocking 101Mocking 101
Mocking 101
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 

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
  • 3.
  • 4.
  • 5.
  • 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

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n