Managed Extensibility Framework

conversebazaarSoftware and s/w Development

Nov 2, 2013 (3 years and 11 months ago)

106 views

Managed Extensibility Framework

Mahender

Senior Software Engineer

United Health Group

Mahender Sarangam


Having

5

years

of

experience

on

.
NET

Technologies
.

Working

as

a

Senior

Software

Engineer

in

United

Health

Group

(UHG

India

Information

Service

Ltd
.
)
.

Worked

with

Big

Firms

like

Deloitte

Consulting

&

Wipro

Technology
.




Got

Technical

Acquaintance

on

Technologies

like

C#,

ASP
.
NET,AJAX,

LINQ,

Silverlight,

WPF,WCF

,SQL

Server,

Team

Foundation

Server(TFS)

and

SharePoint

Technology
.




MCTS

Certified

in

Web

Technologies
.


Blog

:

http
:
//
Msarangam
.
wordpress
.
com



Dependency Injection


Idea of the Dependency Injection is to have a separate
object, an assembler, that populates a field in the
listener class with an appropriate implementation for
the finder interface.



interface injection


setter injection


constructor injection.


Dependency injection is a style of object configuration
in which an objects fields and collaborators are set by
an external entity.


Dependency injection is an alternative to having the
object configure itself .


Loose coupling promotes greater reusability, easier
maintainability, and allows you to easily provide
"mock" objects in place of services instances


Instantiation, Configuration and Disposal


Life cycle management is one of the responsibilities
dependency containers like Singleton


For .NET :
-

Castle Windsor, Spring.NET,

PicoContainer.NET
,

Puzzle .
NFactory

,
Unity


Benefits:


Reduced Dependencies


Reduced Dependency Carrying


More Reusable Code


More Testable Code


More Readable Code



Responsibilities

MEF

MEF


The Managed Extensibility Framework (or MEF for
short) simplifies the creation of
extensible
applications.


Plug
-
in components to an already running application


Discovery and Composition capabilities that you can
leverage to load application extensions
.


Benefits


Dependency injection and inversion of control.


Lifetime management


Configuration


Import Many


Modularity


Extensibility


Strongly Typed




System.ComponentModel.Composition.dll

-
>
Assembly come part of .NET Framework 4.0


If the version of application is < .NET 4.0, Download
MEF Zip file from
codeplex

site


Here are MEF Jargon


Part


Catalog


Contract


Import


Export


Compose



Steps for MEF


Create Import


Create Export attribute of same type of Import


Create instance of Assembly Catalog


Composite Container to Compose

Catlogs


Assembly Catalog


Directory Catalog


Directory Catalog


Type Catalog


DeploymentCatalog

-

Silverlight only







Thank you