SlideShare ist ein Scribd-Unternehmen logo
1 von 22
MEF in Silverlight 4 – a guided tour Mike Taulty Microsoft Ltd mtaulty@microsoft.com mtaulty.com twitter.com/mtaulty
[background]
MEF – What is it? How do I get it? the Managed Extensibility Framework an extensible framework for composing applications from a set of loosely-coupled parts discovered and evolving at run-time  versions .NET Framework shipping with Silverlight 4  .NET Framework 4 shipping with VS 2010 Silverlight 3 & .NET Framework V3.5 Sp1 Source on CodePlex
“scenario” iTunesMediaPlayer Constructor() GetAlbumInfo(“Blood on the Tracks”) IAlbumInfoProvider AlbumInfoProvider Constructor() GetAlbumArt(“Blood on the Tracks”) IAlbumArtProvider AlbumArtProvider
“scenario” iTunesMediaPlayer Constructor() GetAlbumInfo(“Blood on the Tracks”) AlbumInfoProvider Constructor() GetAlbumArt(“Blood on the Tracks”) AlbumArtProvider ,[object Object]
Hard to test AlbumInfoProvider in isolation from AlbumArtProvider
Hard to drop in a different AlbumArtProvider implementation
Code changes to AlbumArtProvider impact AlbumInfoProvider,[object Object]
Easier to test AlbumInfoProvider with anyIAlbumArtProvider
Easier to drop in new implementations of IAlbumArtProvider
Version changes to AlbumArtProvider do not impact AlbumInfoProvider,[object Object]
the IoC Container Container iTunesMediaPlayer Get<IAlbumInfoProvider>() AlbumArtProvider AlbumArtProvider Constructor(IAlbumArtProvider) Constructor(IAlbumArtProvider) AlbumInfoProvider AlbumInfoProvider
[end of background]
example ( Unity IoC )
but MEF is not ‘just’ another IoC container an extensible framework for composing applications from a set of loosely-coupled parts discovered and evolving at run-time
using MEF in our scenario demo
MEF models composable parts import import import Part export export
MEF composes parts import import import import import import import part part part part import import export export export Composition Engine export part part part part part
which parts compose together? import import import part export export ? import part
matching imports to exports demo
parts & part definitions import import import import Part PartDefinition CreatePart() export export export PartDefinition is a blueprint for a Part similar to Object and Type in .NET but can have Part without PartDefinition
container draws parts from catalogs PartDefinition PartDefinition PartDefinition PartDefinition PartDefinition PartDefinition PartDefinition PartDefinition PartDefinition import import import PartDefinition import import import PartDefinition import import import PartDefinition Part Part Part Catalog Catalog Catalog export export export export export export Catalog CompositionContainer

Weitere Àhnliche Inhalte

Ähnlich wie MEF in Silverlight 4 - a guided tour

Managed Extensibility Framework or Effective Development of Scalable Applicat...
Managed Extensibility Framework or Effective Development of Scalable Applicat...Managed Extensibility Framework or Effective Development of Scalable Applicat...
Managed Extensibility Framework or Effective Development of Scalable Applicat...
SoftServe
 
Managed Extensibility Framework
Managed Extensibility FrameworkManaged Extensibility Framework
Managed Extensibility Framework
Volodymyr Voytyshyn
 
Mike Taulty Beyond Silverlight With W P F
Mike Taulty  Beyond  Silverlight  With  W P FMike Taulty  Beyond  Silverlight  With  W P F
Mike Taulty Beyond Silverlight With W P F
ukdpe
 
MEF Deep Dive by Piotr Wlodek
MEF Deep Dive by Piotr WlodekMEF Deep Dive by Piotr Wlodek
MEF Deep Dive by Piotr Wlodek
infusiondev
 
Lap around .net 4
Lap around .net 4Lap around .net 4
Lap around .net 4
Abdul Khan
 
Railo Presentation Railo 3.1
Railo Presentation Railo 3.1Railo Presentation Railo 3.1
Railo Presentation Railo 3.1
Rhinofly
 

Ähnlich wie MEF in Silverlight 4 - a guided tour (20)

Managed Extensibility Framework or Effective Development of Scalable Applicat...
Managed Extensibility Framework or Effective Development of Scalable Applicat...Managed Extensibility Framework or Effective Development of Scalable Applicat...
Managed Extensibility Framework or Effective Development of Scalable Applicat...
 
Managed Extensibility Framework
Managed Extensibility FrameworkManaged Extensibility Framework
Managed Extensibility Framework
 
Mike Taulty Beyond Silverlight With W P F
Mike Taulty  Beyond  Silverlight  With  W P FMike Taulty  Beyond  Silverlight  With  W P F
Mike Taulty Beyond Silverlight With W P F
 
Extending the Enterprise with MEF
Extending the Enterprise with MEFExtending the Enterprise with MEF
Extending the Enterprise with MEF
 
What's New for Presentation in Visual Studio 2008 SP1
What's New for Presentation in Visual Studio 2008 SP1What's New for Presentation in Visual Studio 2008 SP1
What's New for Presentation in Visual Studio 2008 SP1
 
MEF Deep Dive by Piotr Wlodek
MEF Deep Dive by Piotr WlodekMEF Deep Dive by Piotr Wlodek
MEF Deep Dive by Piotr Wlodek
 
Plug yourself in and your app will never be the same (2 hr editon)
Plug yourself in and your app will never be the same (2 hr editon)Plug yourself in and your app will never be the same (2 hr editon)
Plug yourself in and your app will never be the same (2 hr editon)
 
Plug yourself in and your app will never be the same (2 hour edition)
Plug yourself in and your app will never be the same (2 hour edition)Plug yourself in and your app will never be the same (2 hour edition)
Plug yourself in and your app will never be the same (2 hour edition)
 
All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$
 
VMware Studio & vAPP-s
VMware Studio & vAPP-sVMware Studio & vAPP-s
VMware Studio & vAPP-s
 
​Abinitio online training
​Abinitio online training​Abinitio online training
​Abinitio online training
 
IoT Seminar (Oct. 2016) Alex Edelmann - Bosch Singapore
IoT Seminar (Oct. 2016) Alex Edelmann - Bosch SingaporeIoT Seminar (Oct. 2016) Alex Edelmann - Bosch Singapore
IoT Seminar (Oct. 2016) Alex Edelmann - Bosch Singapore
 
Reusando componentes Zope fuera de Zope
Reusando componentes Zope fuera de ZopeReusando componentes Zope fuera de Zope
Reusando componentes Zope fuera de Zope
 
Lap around .net 4
Lap around .net 4Lap around .net 4
Lap around .net 4
 
Adobe is from Mars, Microsoft is from Uranus. A look at two competing web st...
Adobe is from Mars, Microsoft is from Uranus.  A look at two competing web st...Adobe is from Mars, Microsoft is from Uranus.  A look at two competing web st...
Adobe is from Mars, Microsoft is from Uranus. A look at two competing web st...
 
SynapseIndia dotnet development framework
SynapseIndia  dotnet development frameworkSynapseIndia  dotnet development framework
SynapseIndia dotnet development framework
 
Power Apps Component Framework - Dynamics Power! 365 Paris 2019
Power Apps Component Framework - Dynamics Power! 365 Paris 2019  Power Apps Component Framework - Dynamics Power! 365 Paris 2019
Power Apps Component Framework - Dynamics Power! 365 Paris 2019
 
java swing programming
java swing programming java swing programming
java swing programming
 
Railo Presentation Railo 3.1
Railo Presentation Railo 3.1Railo Presentation Railo 3.1
Railo Presentation Railo 3.1
 
Migrate To Lightning Web Components from Aura framework to increase performance
Migrate To Lightning Web Components from Aura framework to increase performance Migrate To Lightning Web Components from Aura framework to increase performance
Migrate To Lightning Web Components from Aura framework to increase performance
 

Mehr von mark mann

Mehr von mark mann (11)

"Ui2" Pitch by Matt Mould for #TFTLondon
"Ui2" Pitch by Matt Mould for #TFTLondon"Ui2" Pitch by Matt Mould for #TFTLondon
"Ui2" Pitch by Matt Mould for #TFTLondon
 
"iLife" Pitch by Lee Provoost for #TFTLondon
"iLife" Pitch by Lee Provoost  for #TFTLondon"iLife" Pitch by Lee Provoost  for #TFTLondon
"iLife" Pitch by Lee Provoost for #TFTLondon
 
"Scorepedia" Pitch by Jamie Thomson for #TFTLondon
"Scorepedia" Pitch by Jamie Thomson  for #TFTLondon"Scorepedia" Pitch by Jamie Thomson  for #TFTLondon
"Scorepedia" Pitch by Jamie Thomson for #TFTLondon
 
MIX10 Roundup: Developer's Overview
MIX10 Roundup: Developer's OverviewMIX10 Roundup: Developer's Overview
MIX10 Roundup: Developer's Overview
 
MIX10 Roundup: Expression Blend 4
MIX10 Roundup: Expression Blend 4MIX10 Roundup: Expression Blend 4
MIX10 Roundup: Expression Blend 4
 
Working with the Bing Maps Silverlight Control
Working with the Bing Maps Silverlight ControlWorking with the Bing Maps Silverlight Control
Working with the Bing Maps Silverlight Control
 
Silverlight UK User Group #11 Introduction
Silverlight UK User Group #11 IntroductionSilverlight UK User Group #11 Introduction
Silverlight UK User Group #11 Introduction
 
Silverlight UK User Group #10 Introduction
Silverlight UK User Group #10 IntroductionSilverlight UK User Group #10 Introduction
Silverlight UK User Group #10 Introduction
 
Designer-Developer Interaction
Designer-Developer InteractionDesigner-Developer Interaction
Designer-Developer Interaction
 
PRISM and Silverlight
PRISM and SilverlightPRISM and Silverlight
PRISM and Silverlight
 
SilverlightPulse.NET [Silverlight UK User Group]
SilverlightPulse.NET [Silverlight UK User Group]SilverlightPulse.NET [Silverlight UK User Group]
SilverlightPulse.NET [Silverlight UK User Group]
 

KĂŒrzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
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
 

KĂŒrzlich hochgeladen (20)

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
 
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...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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...
 
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...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
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...
 
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
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
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)
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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
 

MEF in Silverlight 4 - a guided tour

  • 1. MEF in Silverlight 4 – a guided tour Mike Taulty Microsoft Ltd mtaulty@microsoft.com mtaulty.com twitter.com/mtaulty
  • 3. MEF – What is it? How do I get it? the Managed Extensibility Framework an extensible framework for composing applications from a set of loosely-coupled parts discovered and evolving at run-time versions .NET Framework shipping with Silverlight 4 .NET Framework 4 shipping with VS 2010 Silverlight 3 & .NET Framework V3.5 Sp1 Source on CodePlex
  • 4. “scenario” iTunesMediaPlayer Constructor() GetAlbumInfo(“Blood on the Tracks”) IAlbumInfoProvider AlbumInfoProvider Constructor() GetAlbumArt(“Blood on the Tracks”) IAlbumArtProvider AlbumArtProvider
  • 5.
  • 6. Hard to test AlbumInfoProvider in isolation from AlbumArtProvider
  • 7. Hard to drop in a different AlbumArtProvider implementation
  • 8.
  • 9. Easier to test AlbumInfoProvider with anyIAlbumArtProvider
  • 10. Easier to drop in new implementations of IAlbumArtProvider
  • 11.
  • 12. the IoC Container Container iTunesMediaPlayer Get<IAlbumInfoProvider>() AlbumArtProvider AlbumArtProvider Constructor(IAlbumArtProvider) Constructor(IAlbumArtProvider) AlbumInfoProvider AlbumInfoProvider
  • 15. but MEF is not ‘just’ another IoC container an extensible framework for composing applications from a set of loosely-coupled parts discovered and evolving at run-time
  • 16. using MEF in our scenario demo
  • 17. MEF models composable parts import import import Part export export
  • 18. MEF composes parts import import import import import import import part part part part import import export export export Composition Engine export part part part part part
  • 19. which parts compose together? import import import part export export ? import part
  • 20. matching imports to exports demo
  • 21. parts & part definitions import import import import Part PartDefinition CreatePart() export export export PartDefinition is a blueprint for a Part similar to Object and Type in .NET but can have Part without PartDefinition
  • 22. container draws parts from catalogs PartDefinition PartDefinition PartDefinition PartDefinition PartDefinition PartDefinition PartDefinition PartDefinition PartDefinition import import import PartDefinition import import import PartDefinition import import import PartDefinition Part Part Part Catalog Catalog Catalog export export export export export export Catalog CompositionContainer
  • 23. or mix in pre-instantiated parts part Imports(“Foo”) Compose() part Exports(“Foo”) CompositionContainer
  • 25. things change - recomposition New parts [introduced to/removed from] container may have an impact on this import – a part can opt-in to allow this recomposition part Compose() part? part CompositionContainer part Catalog Catalog Catalog PartDefinition PartDefinition PartDefinition PartDefinition Some catalogs support additions
  • 26. recomposition is key for Silverlight initial, small download MyApp.xap Extras.xap additional functionality
  • 27. recomposition & the DeploymentCatalog demo
  • 28. stable composition reject parts with unsatisfied imports reject changes that break existing “agreements” part part requires exactly one part requires part part requires CompositionContainer missing different part, same contract part
  • 30. MEF and Model View ViewModel Strong separation of concerns possible with Silverlight development user interface declared in XAML loosely binds to data functionality invoked by declarative commands Encapsulated by the “MVVM” pattern binding model (“data”) viewmodel (state & data for view) view (declarative XAML) commands
  • 31. MVVM via MEF demo
  • 32. resources Glenn Block blogs.msdn.com/gblock Nicholas Blumhardt blogs.msdn.com/nblumhardt MEF on CodePlex mef.codeplex.com Channel 9 Silverlight 4 MEF Screencasts channel9.msdn.com/tags/learnMEFSL4
  • 33. feedbackMicrosoft Session Feedback via Twitter @msftsession 10 @mtaulty #sluguk ... session score out of 10 ( 10 is recommended but other scores are possible )