Managed Extensibility Framework (MEF)
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

Managed Extensibility Framework (MEF)

  • 2,364 views
Uploaded on

MEF in Action: import, export e compose

MEF in Action: import, export e compose

More in: Technology , Education
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
2,364
On Slideshare
1,809
From Embeds
555
Number of Embeds
4

Actions

Shares
Downloads
32
Comments
0
Likes
1

Embeds 555

http://www.manuelscapolan.it 551
http://www.linkedin.com 2
http://translate.googleusercontent.com 1
http://www.docshut.com 1

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

Transcript

  • 1. Managed Extensibility Framework (MEF)1nn0vaLab
  • 2. Managed Extensibility Framework (MEF)1nn0vaLab
  • 3. Managed Extensibility Framework (MEF) MEF è un framework che offre alle applicazioni la capacità di essere estese dinamicamente attraverso componenti esterni noti solo a runtime1nn0vaLab
  • 4. for extension part / component for modification1nn0vaLab
  • 5. Managed Extensibility Framework (MEF) Export it Import it Compose it1nn0vaLab
  • 6. Managed Extensibility Framework (MEF) Definiamo prima il servizio (part) da esporre Utilizzare sempre le interfacce per definire i contratti da esportare Part A1nn0vaLab
  • 7. Managed Extensibility Framework (MEF) Definiamo prima il servizio (part) da esporre Dichiariamo l’implementazione da rendere disponibile ai consumer Part A1nn0vaLab
  • 8. Managed Extensibility Framework (MEF) Definiamo nel consumer il “punto di estensione” Part A1nn0vaLab
  • 9. Managed Extensibility Framework (MEF) Dove cerca MEF le parti da utilizzare? TypeCatalog AssemblyCatalog Catalog DirectoryCatalog AggregateCatalog1nn0vaLab
  • 10. Managed Extensibility Framework (MEF) Come risolve i collegamenti import/export? Dove cerca MEF le parti da utilizzare? Container1nn0vaLab
  • 11. It’s DEMO time!
  • 12. Managed Extensibility Framework (MEF) MEF architecture1nn0vaLab
  • 13. Managed Extensibility Framework (MEF) Part by discovery Part by registration External configuration, NO configuration via Fluent API or XML Wiring in the part Auto Wiring Almost pure POCO Pure POCO1nn0vaLab
  • 14. Managed Extensibility Framework (MEF) • Metadata support • Be “lazy” • Recomposition1nn0vaLab
  • 15. Managed Extensibility Framework (MEF) Possiamo associare al servizio informazioni aggiuntive (metadati) in modo da farle leggere ai consumer ... ... per esempio per filtrare le implementazioni da importare1nn0vaLab
  • 16. Managed Extensibility Framework (MEF) ... per esempio per filtrare le implementazioni da importare1nn0vaLab
  • 17. Managed Extensibility Framework (MEF) Eseguire l’importazione solo nel momento in cui viene utilizzata! Lazy<T,M> (con M metadata) è utile per filtrare le importazioni in base ai metadati1nn0vaLab
  • 18. Managed Extensibility Framework (MEF) Con MEF possiamo avere la ricomposizione automatica delle parti in caso di aggiunta di nuove estensioni (o rimozione di una esistente) [ImportMany(AllowRecomposition(true)] + IPartImportsSatisfiedNotification1nn0vaLab
  • 19. Managed Extensibility Framework (MEF) Dynamically loading XAPs with MEF http://channel9.msdn.com/Shows/SilverlightTV/Silverlight -TV-11-Dynamically-Loading-XAPs-with-MEF1nn0vaLab
  • 20. Managed Extensibility Framework (MEF) Resources Project hosting on codeplex http://mef.codeplex.com Community-developed library of extensions http://mefcontrib.codeplex.com/ Hamilton Verissimo (the “MEF man”) http://blogs.msdn.com/b/hammett/ Glenn Block (the “MEF maniac”) http://codebetter.com/glennblock/1nn0vaLab
  • 21. CreditsLe immagini contenute in questa presentazioneeccetto la foto iniziale acquistata suiStockPhoto hanno licenza Creative CommonsSlide 2 : http://www.flickr.com/photos/69691418@N00/4368951793/Slide 3 : http://www.flickr.com/photos/16013376@N00/4562002778/
  • 22. Thank You! MANUEL SCAPOLAN website: www.manuelscapolan.it twitter: manuelscapolan e-mail: info@manuelscapolan.it 23