Extensibility in Application using MEF By Abhishek Sur Website: www.abhisheksur.com Email : [email protected] Twitter : @abhi2434 www.kolkatageeks.com
May 10, 2015
Extensibility in Applicationusing MEFBy Abhishek Sur
Website: www.abhisheksur.comEmail : [email protected]
Twitter : @abhi2434
www.kolkatageeks.com
Agenda
Adding MEF into it
Developing an extensible application
What is Extensibility?
What is Extensibility
Extensiblity
Extensibility is an ability to design an application in such a manner so that 3rd party vendor can come along and customize it.
Extensibility does not require the application to be redeployed.
Extensible applications are flexible on client needs.
Examples : Microsoft Office, Skype, World Warcraft etc.
Bertrand Meyer’s Open Close Principle
Benefits of Extensible application Reusability Modularizing Loose Coupling Greater Momentum Support for 3rd party vendors Feeling of Ownership
Problems of Extensible application Development process is more complex. Architecture should be thought before
actual development begins. Security More error prone
Extensibility in your Application
Demo
Managed Extensibility
Framework
How to MEF
MEF
Compose It
Import It
Export It
Export
Import
Compose
MEF Architecture
Catalog
CustomExportProviderCatalogExportProvider AggregatingExportProvider
CompositionContainer
Part
Export Import
Part
Export Import
Part
Export Import
MEF
Catalog◦ Discovers and maintain extensions
CompositionContainer◦ Coordinate creations and satisfy dependencies
ComposablePart◦ Are Imports and Exports that are composable to
the Container Support for LAZY Support for Dynamic Recomposition
Adding MEF to the application
Demo
Finally
Visual Studio is rich with MEF components They export functionality that your code
might need. They import functionality that your code
might offer. Your extension can export:
◦ IWPFTextViewMarginProvider◦ ITaggerProvider◦ IMouseProcessorProvider◦ ICompletionSourceProvider◦ There are lots more…….
References MEF Article
◦ http://tinyurl.com/MEFWORLD MEF Tips
◦ http://tinyurl.com/mefTips MEF Source
◦ http://tinyurl.com/MEFSOURCE MEF Guide
◦ http://tinyurl.com/mefguide MEF Blogs
◦ http://tinyurl.com/mefBlogs MEF Discussions
◦ http://tinyurl.com/mefDiscussions
Thank you.
Twitter : @abhi2434
Email: [email protected]
www.abhisheksur.com
Abhishek Sur, MVP (Client App Dev)