SlideShare a Scribd company logo
1 of 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

More Related Content

Viewers also liked

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
 

Viewers also liked (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
 

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

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

Recently uploaded

Microsoft BitLocker Bypass Attack Method.pdf
Microsoft BitLocker Bypass Attack Method.pdfMicrosoft BitLocker Bypass Attack Method.pdf
Microsoft BitLocker Bypass Attack Method.pdf
Overkill Security
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
FIDO Alliance
 
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
 
CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)
Wonjun Hwang
 

Recently uploaded (20)

State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
Microsoft BitLocker Bypass Attack Method.pdf
Microsoft BitLocker Bypass Attack Method.pdfMicrosoft BitLocker Bypass Attack Method.pdf
Microsoft BitLocker Bypass Attack Method.pdf
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfFrisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overview
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cf
 
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
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptx
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream Processing
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
 

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.

Editor's Notes

  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