Here is the sixth post of the Fav 3 series that we are continuing. Today’s favorite tips are based on Managed Extensibility Framework or MEF. #1 Working with Catalogs in MEF TypeCatalog, AssemblyCatalog, DirectoryCatalog & AggreagateCatalog are the four types of Catalogs yet supported by MEF. This tips talks about how to use different types of catalogs while dealing with… Read More »
Part Lifetime is one of the most important hindrances that we face while working with MEF. It is very important to understand how the parts are going to be shared between plugins such that having been so much open ended, 3rd party plugins remain separated to the objects that you do not want to be shared outside. In… Read More »
Just like what I have talked for so long in my blog entries about Import, ImportConstructor is another attribute that you can annotate only for a constructor. Sometimes it is needed to have some kind of Dependency that needs to be injected while constructing the object. In case of a normal Import, the Property is set using Default… Read More »
MEF Supports metadata to be passed in addition to Contracts. As we have already discussed some of the interesting catalogs present in MEF base class library, lets take a look how metadata can be transferred in the MEF system. We generally use MetaData to determine something regarding the type. Probably when the actual object is unavailable. Lazy implementation… Read More »
CompositionBatch is a new type introduced with MEF library that allows you to individually deal with Part instances. Generally when we are in a situation that we need to manually handle certain type, or more precisely when we need to create the types manually ourselves, it is recommended to use CompositionBatch. Basically you thing think CompositionBatch is just… Read More »
MEF supports an opt-in feature that allows recomposition of the Import when the underlying object is changed either explicitely by the user or in the Catalog. The Recomposable Import unit is called live import as it automatically changes the object cycle when actual underlying object is changed. Today I will discuss how exactly this works in MEF and… Read More »
Lazy is a class that defer the object creation when it is actually needed. MEF supports the Lazy implementation internally. The Lazy type actually wraps around a type and creates the object of the type when the object is actually needed and used. I have written a post on Lazy implementation in .NET few months ago. In this… Read More »
Managed Extensibility Framework as of now is a new model that deals with Extensibility in application by giving you a standard set of rules by which the vendor who exports components can be related easily to the vendors that imports software components. Hence MEF rules as a standard way of defining extensibility in application.