NuGet Extensions

Thursday, November 17, 2016

Click Dimensions open source the first preview of NuGet Extensions tool which is used internally for managing projects which deployed as NuGet. The development process of solution which is using NuGet of internal component is not easy when Ii t come to debug and upgrade. Consider the case when you’re debugging the application and you find out that there is a bug on the infrastructure. In case when the infrastructure is consume via NuGet you will have to: - Fix the bug. - Pack new version of the infrastructure (NuGet). - Update the application. - Re-test it with the...
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...