MEF 2.0 – mini series: Part 7 (Catalog filter and Deep hierarchic scoping)

2013/01/24

MEF 2.0 - mini series: Part 7 (Catalog filter and Deep hierarchic scoping) this is the 7th post in the MEF 2.0 mini series. you can see the following TOC for other posts in this series. in the previous post I was talking about composition scoping and lifetime management. on this one, I will extend the composition scoping topic toward hierarchic along with catalog filtering capability. hierarchic scoping is not trivial, you must understand the hierarchic behavior and what it was design for. MEF hierarchic...

MEF 2.0 – mini series: part 6 (Composition scoping and lifetime management)

MEF 2.0 - mini series: part 6 (Composition scoping and lifetime management) this is the 6th post in the MEF 2.0 mini series. you can see the following TOC for other posts in this series. in this post I will cover a new concept of scoping and part lifetime management, which is a great improvement over MEF 1. MEF 1 was coming with a fairly naïve lifetime management. part's lifetime could be either shared or non-shared (you could also apply 'any' but eventually 'any'...

MEF 2.0 – mini series: part 5 (Fluent export properties)

2013/01/15

MEF 2.0 - mini series: part 5 (Fluent export properties) this is the 5th post in the MEF 2.0 mini series. you can see the following TOC for other posts in this series. in this post I will cover the fluent property's export. Exporting properties is a less known feature of MEF. MEF 1 was supporting this feature by using the attribute model. you could decorate a property with a attribute and then it become available for imports. the following...

Async and AggregateException

Async and AggregateException this post is a complementary to Eran Stiller's post. I was reading Eran Stiller's post about exception handling using async methods and I want to add a few side notes. 1) the exception handling behavior decisions is well documented in this post (by the TPL team), it decided after they had consider different options. 2) I was suggesting that compiler will check whether the a catch of AggregateException is implemented and if so to avoid the unwrapping behavior. in this case the...

Entity Framework – Pro and Con

2013/01/13

Entity Framework - Pro and Con Consulting as part of a consultant group can lead to better consulting. Sela Israel consultant group is around 40 consultants many of them are speakers in local and international conference. It happens that one of our customers was having some issues around the usage of Entity Framework. even those I was thinking that I'm having most of the answer for that customer I decided to use our internal channel to query what are my colleagues opinions about those issues and sea whether they can enlighten...

MEF 2.0 – mini series: part 4 (Fluent Import)

2013/01/12

MEF 2.0 - mini series: part 4 (Fluent Import) this is the 4th post in the MEF 2.0 mini series. you can see the following TOC for other posts in this series. in this post I will discuss the Fluent import API. we was talking about Fluent Export and Constructor Injection in the previous posts. this post will complete the main scenarios of Import's fluent API. I will demonstrate the import technique using the following classes: Code Snippet public class Foo {     public Logger Log {...

MEF 2.0 – mini series: part 3 (Fluent import constructor)

2013/01/09

MEF 2.0 - mini series: part 3 (Fluent import constructor) this is the 3rd post in the MEF 2.0 mini series. you can see the following TOC for other posts in this series. in this post I will discuss the fluent constructor injection API. Constructor Injection the following code is having a Logger and Worker class which is having 2 constructor (one has no parameters and the other is getting ILogger): Code Snippet   public class Logger: ILogger {     public void Write(string message) {...

MEF 2.0 – mini series: part 2 (Fluent and Conventional Export)

2013/01/06

MEF 2.0 - mini series: part 2 (Fluent and Conventional Export) this is the second post in the MEF 2.0 mini series. you can see the following TOC for more. in this post I will start to cover the fluent discovery model and the idea of discovery by convention. traditionally, out of the box, MEF come with a single discovery model, which was the Attribute model. it is true that you could extend MEF's discovery model by using either a custom catalog or a custom export provider, but...