SlideShare ist ein Scribd-Unternehmen logo
1 von 23
When MEF meets Silverlight AmrElsehemy amr.elsehemy@me.com 1
Speaker TA at Faculty of Information and Computer Science Ain Shams University Senior Software Engineer at ITWorx MCSD, MCPD + more. 2
What's MEF? The Managed Extensibility Framework “The Managed Extensibility Framework (MEF) is a new library in .NET 4 / Silverlight 4 for building applications that can be incrementally extended” – mef team “An extensible framework for composing applications from a set of loosely-couple parts discovered and evolving at run-time” – mtaulty 3
WhywasMEF built? 4 I need A Put the D Can I have C F E F B A App C G D Add B G Then get me E
Why MEF For customers For you and your team  Always there, always ready In the framework! 5
MEF Basics… 6 An Application is built of parts
Demo Building our thing 7
3 Magic steps  Export it Import it Compose it 8
Export it 9 [Export(typeof(IThing))] publicclassThing { } IThing Export 9
Import it  10 publicclassMainPage {     [Import(typeof(IThing))]     publicIThing thing; } IThing Import 10
Compose it  11 publicclassMainPage { publicMainPage() {             CompositionInitializer.SatisfyImports(this); } Compose 11
Demo Giving more 12
Import it - Metadata 13 [ImportMany] publicIEnumerable<Lazy<IThing, IThingMetadata>> somethings; IThing ImportMany
Export it - Metadata 14 [ExportMetadata("Position", ThingPosition.Left)] [Export(typeof(IThing))] publicpartialclassThing { } Put me in the left IThing Export
Customize it – Custom exports 15 [ThingExport(Position = ThingPosition.Left)]    publicclassThing {} Put me in the left IThing Export 15
Demo Exploring the catalogs 16
TypeCatalog AssemblyCatalog AggregateCatalog Compose it – Catalogs 17
Demo Trim your apps break up your xaps 18
Recomopose- DeploymentCatalog Recomposition is key in Silverlight apps Initial download, small in size. Download more functionality. A special Silverlight catalog DeploymentCatalog. Trace changes with IPartImportsSatisfiedNotification 19
MEF here, there, everywhere Samples 20
MEF versions .NET Framework shipping with Silverlight4 .NET Framework 4 shipping with VS 2010 Silverlight 3 & .NET Framework V3.5 SP1 Source on Codeplex (MSPL) 21
Resources silverlight.net mef.codeplex.com mefcontrib.codeplex.com blogs.msdn.com/gblock mtaulty.com – He is awesome! channel9.msdn.com/tags/learnMEFSL4 22
Questions? 23

Weitere ähnliche Inhalte

Andere mochten auch

Crossing barriers
Crossing barriersCrossing barriers
Crossing barriers
ibaronina
 
Walmart The Nation Of Domination WAL mart strategies in china
Walmart The Nation Of Domination WAL mart strategies in chinaWalmart The Nation Of Domination WAL mart strategies in china
Walmart The Nation Of Domination WAL mart strategies in china
guest86aa80
 
AlpesJUG - Communautés opensource, stratégies et écueils
AlpesJUG - Communautés opensource, stratégies et écueilsAlpesJUG - Communautés opensource, stratégies et écueils
AlpesJUG - Communautés opensource, stratégies et écueils
julien.ponge
 
Mengenal Dan Membezakan Warna
Mengenal Dan Membezakan WarnaMengenal Dan Membezakan Warna
Mengenal Dan Membezakan Warna
azirah azizul
 

Andere mochten auch (15)

shelby and katy.
shelby and katy.shelby and katy.
shelby and katy.
 
Presentazione2
Presentazione2Presentazione2
Presentazione2
 
Presentazione2
Presentazione2Presentazione2
Presentazione2
 
Teaser Chemic
Teaser   ChemicTeaser   Chemic
Teaser Chemic
 
Crossing barriers
Crossing barriersCrossing barriers
Crossing barriers
 
Be merge preview
Be merge previewBe merge preview
Be merge preview
 
Interesting Sights in China
Interesting Sights in ChinaInteresting Sights in China
Interesting Sights in China
 
Obra pictórica de Antonia Dávalos
Obra pictórica  de Antonia DávalosObra pictórica  de Antonia Dávalos
Obra pictórica de Antonia Dávalos
 
Walmart The Nation Of Domination WAL mart strategies in china
Walmart The Nation Of Domination WAL mart strategies in chinaWalmart The Nation Of Domination WAL mart strategies in china
Walmart The Nation Of Domination WAL mart strategies in china
 
Geographical Position
Geographical Position Geographical Position
Geographical Position
 
Centre For Arciteck And Conservation
Centre For Arciteck And ConservationCentre For Arciteck And Conservation
Centre For Arciteck And Conservation
 
FOSS - PoitouJUG
FOSS - PoitouJUGFOSS - PoitouJUG
FOSS - PoitouJUG
 
AlpesJUG - Communautés opensource, stratégies et écueils
AlpesJUG - Communautés opensource, stratégies et écueilsAlpesJUG - Communautés opensource, stratégies et écueils
AlpesJUG - Communautés opensource, stratégies et écueils
 
Mengenal Dan Membezakan Warna
Mengenal Dan Membezakan WarnaMengenal Dan Membezakan Warna
Mengenal Dan Membezakan Warna
 
Pendekatan, Kaedah, Teknik Dan Strategi
Pendekatan, Kaedah, Teknik Dan StrategiPendekatan, Kaedah, Teknik Dan Strategi
Pendekatan, Kaedah, Teknik Dan Strategi
 

Ähnlich wie When MEF meets Silverlight

Erez Hanit's Résumé
Erez Hanit's RésuméErez Hanit's Résumé
Erez Hanit's Résumé
Erez Hanit
 
Claromentis Tech RoadMap 2015
Claromentis Tech RoadMap 2015Claromentis Tech RoadMap 2015
Claromentis Tech RoadMap 2015
claromentis
 

Ähnlich wie When MEF meets Silverlight (20)

NET Event - Migrating WinForm
NET Event - Migrating WinFormNET Event - Migrating WinForm
NET Event - Migrating WinForm
 
A comparative study of laravel and symfony PHP frameworks
A comparative study of laravel and symfony PHP frameworksA comparative study of laravel and symfony PHP frameworks
A comparative study of laravel and symfony PHP frameworks
 
Extending the Enterprise with MEF
Extending the Enterprise with MEFExtending the Enterprise with MEF
Extending the Enterprise with MEF
 
PHP Frameworks and Symfony
PHP Frameworks and SymfonyPHP Frameworks and Symfony
PHP Frameworks and Symfony
 
Erez Hanit's Résumé
Erez Hanit's RésuméErez Hanit's Résumé
Erez Hanit's Résumé
 
What the heck is Eclipse Modeling and why should you care !
What the heck is Eclipse Modeling and why should you care !What the heck is Eclipse Modeling and why should you care !
What the heck is Eclipse Modeling and why should you care !
 
Pre-Con Education: Introduction to Mainframe Academy With CA Technologies
Pre-Con Education: Introduction to Mainframe Academy With CA TechnologiesPre-Con Education: Introduction to Mainframe Academy With CA Technologies
Pre-Con Education: Introduction to Mainframe Academy With CA Technologies
 
Sela Intl Cust Presentation By Brandon Multichannel Mktg
Sela Intl Cust Presentation   By Brandon Multichannel MktgSela Intl Cust Presentation   By Brandon Multichannel Mktg
Sela Intl Cust Presentation By Brandon Multichannel Mktg
 
Sela Intl Cust Presentation By Brandon Multichannel Mktg
Sela Intl Cust Presentation   By Brandon Multichannel MktgSela Intl Cust Presentation   By Brandon Multichannel Mktg
Sela Intl Cust Presentation By Brandon Multichannel Mktg
 
Ordina SOFTC Presentation - TFS and JAVA, better together
Ordina SOFTC Presentation - TFS and JAVA, better togetherOrdina SOFTC Presentation - TFS and JAVA, better together
Ordina SOFTC Presentation - TFS and JAVA, better together
 
Fun with ASP.NET MVC 3, MEF and NuGet
Fun with ASP.NET MVC 3, MEF and NuGetFun with ASP.NET MVC 3, MEF and NuGet
Fun with ASP.NET MVC 3, MEF and NuGet
 
The distinct advantages of using PHP-Symfony Framework
The distinct advantages of using PHP-Symfony FrameworkThe distinct advantages of using PHP-Symfony Framework
The distinct advantages of using PHP-Symfony Framework
 
Jay's CV - 2013
Jay's CV - 2013Jay's CV - 2013
Jay's CV - 2013
 
Claromentis Tech RoadMap 2015
Claromentis Tech RoadMap 2015Claromentis Tech RoadMap 2015
Claromentis Tech RoadMap 2015
 
Morne Maritz CV
Morne Maritz CVMorne Maritz CV
Morne Maritz CV
 
Clifford nelson resume_16-06
Clifford nelson resume_16-06Clifford nelson resume_16-06
Clifford nelson resume_16-06
 
The managed extensibility framework
The managed extensibility frameworkThe managed extensibility framework
The managed extensibility framework
 
Rc2010 mef
Rc2010 mefRc2010 mef
Rc2010 mef
 
PHP Frameworks That Will Woo-Trick Your Web Application Development in 2019
PHP Frameworks That Will Woo-Trick Your Web Application Development in 2019PHP Frameworks That Will Woo-Trick Your Web Application Development in 2019
PHP Frameworks That Will Woo-Trick Your Web Application Development in 2019
 
Mohammed-Khairy-Abo-Eleneen
Mohammed-Khairy-Abo-EleneenMohammed-Khairy-Abo-Eleneen
Mohammed-Khairy-Abo-Eleneen
 

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@
 
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
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Kürzlich hochgeladen (20)

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
+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...
 
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
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
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...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
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
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
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
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
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
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
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
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
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...
 
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...
 
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
 

When MEF meets Silverlight

  • 1. When MEF meets Silverlight AmrElsehemy amr.elsehemy@me.com 1
  • 2. Speaker TA at Faculty of Information and Computer Science Ain Shams University Senior Software Engineer at ITWorx MCSD, MCPD + more. 2
  • 3. What's MEF? The Managed Extensibility Framework “The Managed Extensibility Framework (MEF) is a new library in .NET 4 / Silverlight 4 for building applications that can be incrementally extended” – mef team “An extensible framework for composing applications from a set of loosely-couple parts discovered and evolving at run-time” – mtaulty 3
  • 4. WhywasMEF built? 4 I need A Put the D Can I have C F E F B A App C G D Add B G Then get me E
  • 5. Why MEF For customers For you and your team Always there, always ready In the framework! 5
  • 6. MEF Basics… 6 An Application is built of parts
  • 8. 3 Magic steps Export it Import it Compose it 8
  • 9. Export it 9 [Export(typeof(IThing))] publicclassThing { } IThing Export 9
  • 10. Import it 10 publicclassMainPage { [Import(typeof(IThing))] publicIThing thing; } IThing Import 10
  • 11. Compose it 11 publicclassMainPage { publicMainPage() { CompositionInitializer.SatisfyImports(this); } Compose 11
  • 13. Import it - Metadata 13 [ImportMany] publicIEnumerable<Lazy<IThing, IThingMetadata>> somethings; IThing ImportMany
  • 14. Export it - Metadata 14 [ExportMetadata("Position", ThingPosition.Left)] [Export(typeof(IThing))] publicpartialclassThing { } Put me in the left IThing Export
  • 15. Customize it – Custom exports 15 [ThingExport(Position = ThingPosition.Left)] publicclassThing {} Put me in the left IThing Export 15
  • 16. Demo Exploring the catalogs 16
  • 17. TypeCatalog AssemblyCatalog AggregateCatalog Compose it – Catalogs 17
  • 18. Demo Trim your apps break up your xaps 18
  • 19. Recomopose- DeploymentCatalog Recomposition is key in Silverlight apps Initial download, small in size. Download more functionality. A special Silverlight catalog DeploymentCatalog. Trace changes with IPartImportsSatisfiedNotification 19
  • 20. MEF here, there, everywhere Samples 20
  • 21. MEF versions .NET Framework shipping with Silverlight4 .NET Framework 4 shipping with VS 2010 Silverlight 3 & .NET Framework V3.5 SP1 Source on Codeplex (MSPL) 21
  • 22. Resources silverlight.net mef.codeplex.com mefcontrib.codeplex.com blogs.msdn.com/gblock mtaulty.com – He is awesome! channel9.msdn.com/tags/learnMEFSL4 22
  • 24.

Hinweis der Redaktion

  1. Senior Software at ITWorxTeaching Assistant and pursing Masters at FCISHaving around 17 MS certsHave a blog at
  2. 1- Create the app (SL4)2- Create the UI3- Import a Widget4- Export a Widget5- Compose the container.
  3. 1- Add a second widget2- Introduce ImportingMany3- Show Lazy4- ExportMetadata5- Custom exports
  4. - Say about the choices (Import/Export combination)- How MEF decides to match Export:ContractNameSharedMetadataContractNameCardinalitySharedRecomposableMetadata
  5. Container , that has some catalogs which are places where MEF asks how to find matchesAdd an assembly catalog, built in catalog
  6. 1- Refactor Things.Extensions2- Make the Allow Recomposible
  7. Not just support features extensibilty, but also as a silverlight application everytimexaps are downloaded you try to cut off download size