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

Más contenido relacionado

Similar a 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
 
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 Fukdpe
 
Extending the Enterprise with MEF
Extending the Enterprise with MEFExtending the Enterprise with MEF
Extending the Enterprise with MEFBrian Ritchie
 
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 SP1ukdpe
 
MEF Deep Dive by Piotr Wlodek
MEF Deep Dive by Piotr WlodekMEF Deep Dive by Piotr Wlodek
MEF Deep Dive by Piotr Wlodekinfusiondev
 
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)Mikkel Flindt Heisterberg
 
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)Mikkel Flindt Heisterberg
 
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 $$Joe Ferguson
 
VMware Studio & vAPP-s
VMware Studio & vAPP-sVMware Studio & vAPP-s
VMware Studio & vAPP-sJaroslav Mraz
 
​Abinitio online training
​Abinitio online training​Abinitio online training
​Abinitio online trainingonlineitguru369
 
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 SingaporeOpen Mobile Alliance
 
Reusando componentes Zope fuera de Zope
Reusando componentes Zope fuera de ZopeReusando componentes Zope fuera de Zope
Reusando componentes Zope fuera de Zopementtes
 
Lap around .net 4
Lap around .net 4Lap around .net 4
Lap around .net 4Abdul Khan
 
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...Eric Fickes
 
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 Allan De Castro
 
java swing programming
java swing programming java swing programming
java swing programming Ankit Desai
 
Railo Presentation Railo 3.1
Railo Presentation Railo 3.1Railo Presentation Railo 3.1
Railo Presentation Railo 3.1Rhinofly
 
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 Bohdan Dovhań
 

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

Más de mark mann

"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 #TFTLondonmark mann
 
"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 #TFTLondonmark mann
 
"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 #TFTLondonmark mann
 
MIX10 Roundup: Developer's Overview
MIX10 Roundup: Developer's OverviewMIX10 Roundup: Developer's Overview
MIX10 Roundup: Developer's Overviewmark mann
 
MIX10 Roundup: Expression Blend 4
MIX10 Roundup: Expression Blend 4MIX10 Roundup: Expression Blend 4
MIX10 Roundup: Expression Blend 4mark mann
 
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 Controlmark mann
 
Silverlight UK User Group #11 Introduction
Silverlight UK User Group #11 IntroductionSilverlight UK User Group #11 Introduction
Silverlight UK User Group #11 Introductionmark mann
 
Silverlight UK User Group #10 Introduction
Silverlight UK User Group #10 IntroductionSilverlight UK User Group #10 Introduction
Silverlight UK User Group #10 Introductionmark mann
 
Designer-Developer Interaction
Designer-Developer InteractionDesigner-Developer Interaction
Designer-Developer Interactionmark mann
 
PRISM and Silverlight
PRISM and SilverlightPRISM and Silverlight
PRISM and Silverlightmark mann
 
SilverlightPulse.NET [Silverlight UK User Group]
SilverlightPulse.NET [Silverlight UK User Group]SilverlightPulse.NET [Silverlight UK User Group]
SilverlightPulse.NET [Silverlight UK User Group]mark mann
 

Más de 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]
 

Último

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 

Último (20)

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 

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 )