SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Semelhante a 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
 

Semelhante a 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
 

Mais de 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
 

Último

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
 

Último (20)

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 

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

Notas do Editor

  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