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

Mais conteúdo relacionado

Destaque

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
 

Destaque (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
 

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

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

Último

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
 
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
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
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
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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
 
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
 
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
 
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
 
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
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
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
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

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.

Notas do Editor

  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