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

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 RobisonAnna Loughnan Colquhoun
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
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 DevelopmentsTrustArc
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
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 2024Rafal Los
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
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?Igalia
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 

Último (20)

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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
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
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
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
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
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?
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 

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 )