Extensibility in application

Post on 10-May-2015

6.593 views 2 download

Tags:

description

Extensibility with .NET 4.0 using MEF.

Transcript of Extensibility in application

Extensibility in Applicationusing MEFBy Abhishek Sur

Website: www.abhisheksur.comEmail : contact@abhisheksur.com

Twitter : @abhi2434

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 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: contact@abhisheksur.com

www.abhisheksur.com

Abhishek Sur, MVP (Client App Dev)