Your SlideShare is downloading. ×
0
When MEF meets Silverlight
When MEF meets Silverlight
When MEF meets Silverlight
When MEF meets Silverlight
When MEF meets Silverlight
When MEF meets Silverlight
When MEF meets Silverlight
When MEF meets Silverlight
When MEF meets Silverlight
When MEF meets Silverlight
When MEF meets Silverlight
When MEF meets Silverlight
When MEF meets Silverlight
When MEF meets Silverlight
When MEF meets Silverlight
When MEF meets Silverlight
When MEF meets Silverlight
When MEF meets Silverlight
When MEF meets Silverlight
When MEF meets Silverlight
When MEF meets Silverlight
When MEF meets Silverlight
When MEF meets Silverlight
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

When MEF meets Silverlight

2,995

Published on

Cairo Code Camp 2010

Cairo Code Camp 2010

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,995
On Slideshare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
22
Comments
0
Likes
3
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

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

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

    ×