Scoping With Autofac IoC

Wednesday, March 9, 2016

Scoping With Autofac IoC This post continue the Microsoft.Composition (Portable MEF): Scoping and it dealing with scoping on Autofac IoC. Now days Autofac is my favorite IoC framework, It has reach API which is relatively easy to use and it has great documentation. It’s also very alive and It has version for .NET Core.   you can read about scoping with Unity IoC on this post. If you didn’t read the Microsoft.Composition post it is recommend to take a look at it before reading this post. this post will focus on...

Scoping With Unity IoC

Monday, March 7, 2016

Scoping With Unity IoC This post continue the Microsoft.Composition (Portable MEF): Scoping and it dealing with scoping on Unity IoC. If you didn’t read the Microsoft.Composition post it is recommend to take a look on it before reading this post. this post will focus on the API (and won’t discuss the concept).   Many IoC support scoping, many times it refer for child container. in this post I will show how, Unity handle this task. On future post I will discuss other container.   Scoping with Unity this is how you do the scoping with Unity: ...
no comments

Microsoft.Composition (Portable MEF): Scoping

Sunday, March 6, 2016

  Microsoft.Composition (Portable MEF): Scoping This post is part of mini series, which complete the full MEF series. This post will go over Microsoft.Composition Scoping.   What is IoC scoping? IoC scoping is the ability to control the lifetime of registration per specific execution scope. whatever resolved in the scope can resolve it’s item that register under the scope or at its parent container.   Classic example for such scope is request. You may want to resolve the same instance again and again within the request scope while keeping it completely isolated from other requests. When supporting this...
no comments

Microsoft.Composition (Portable MEF): Dependency Injection and Service Locator

Wednesday, February 17, 2016

Microsoft.Composition (Portable MEF):  Dependency Injection and Service Locator via Convention This post is part of mini series, which complete the full MEF series. this post will go over Microsoft.Composition Dependency Injection and Service Locator using conventions. in the previous post I describe hot to register types using convention, but in real world types often has their own dependencies which should be satisfies (this is why the IoC process also called composition). In order to satisfy those dependencies you can take different approaches: Dependency Injection constructor-based injection The most common way of passing the dependencies is  constructor-based injection where...

Microsoft.Composition (Portable MEF): Convention

Saturday, February 6, 2016

Microsoft.Composition (Portable MEF): Convention This post is part of mini series, which complete the full MEF series. this post will go over Microsoft.Composition conventions. personally I really like convention over IoC, because it’s lead to better consistency of the code-base’s naming. Convention can be simple as the following code: Code Snippet var conventions = new ConventionBuilder(); conventions.ForType<Logger>().Export<ILogger>(); conventions.ForTypesDerivedFrom<ISetting>()             .ExportInterfaces(t => t == typeof(ISetting)); var configuration = new ContainerConfiguration()     .WithAssembly(typeof(Program).Assembly, conventions);   using (var container = configuration.CreateContainer()) {     container.GetExport<ILogger>(); } As you can see the convention can be strict as in line 2,or more general as in line 3,4.the configuration (line 5,6) define the assembly which the convention relate to. convention can be more...

Microsoft.Composition (Portable MEF): Attribute Model

Microsoft.Composition (Portable MEF): Attribute Model This post is part of mini series, which complete the full MEF series. The original MEF series goes over the version shipped with the .NET framework.This mini series will go over the API of 3rd lightweight (yet efficient) MEF version which consumed via NuGet. This version is following the same concept of the previous changes yet some APIshas been changed. Apart of the APIs refactoring (mostly for better)this MEF version is having much better descriptive Exception (it was really bad on previous versions) The down side of this version is lack of documentation.this mini...

MEF for Beginner (Deployment Catalog) – part 12

Thursday, April 1, 2010

MEF for Beginner (Deployment Catalog) - part 12   this is the 12th post of the MEF for Beginner series, the series TOC is available here. this post will focus on Deployment Catalog.   the code sample for this post can be found here.     What is MEF Deployment Catalogs? the deployment catalog is actually a redesign of the older package catalog. it enable to load parts from xap packages a-synchronically.   Code sample the following code sample depend on 2 assembly that...

MEF Preview 9 released

Friday, February 26, 2010

MEF Preview 9 was released   MEF preview 9 changes will be reflected the in the release of .NET 4.0 and Silverlight 4.0.   except from bug fixing, there was some changes to the API, most of the changes is related to  System.ComponentModel.Composition.Initilization.dll, which is not yet available only for none Silverlight application :-(   here is a short list of API changes: PackageCatalog were brought back, and changed it name to DeploymentCatalog. ...

Catalogs (code cartoon)

Monday, February 15, 2010

Catalogs (code cartoon) catalog are search boundary for the composition container.         you can read more about MEF on MEF for beginner series, the TOC is available here   תגים של Technorati:‏ Extensibility,MEF,Composition,catalogs
no comments

MEF for Beginner (Catalogs) – part 10

Saturday, February 13, 2010

MEF for Beginner (Catalogs) - part 10 this is the 10th post of the MEF for Beginner series, the series TOC is available here. this post will focus on Catalogs.   What is MEF Catalogs? MEF container is using catalogs as its search area definition. the catalog have instructions about where can MEF look for the compose-able parts (import and export definitions). in short catalogs are actually a discovery instruction.   Out of the box catalogs MEF is shipping with the following out of the box...
one comment