MEF 2.0 – mini series: part 1 (Open Generics)
this is the first post of a new mini series about MEF 2.0.
MEF 2.0 is a reflection of a community requests.
features like Open Generics, fluent and conventional discovery, lifetime handling of the part, better exception handling and more, was all requested by the community.
each post of this mini series will target a single enhancement.
one of the most annoying missing feature in MEF 1 was the lack of support for Open generics.
the following code (which is fully functioning in MEF 2.0) didn’t worked in MEF 1.
as obvious as it may seem, this piece of functionality is missing in MEF 1.
if you try to do it in MEF 1 it will look like the following code:
it is quite obvious that extra EventAggregatorInt class shouldn’t have be been there in the first place.
Open Generics if fairly straight forward and it is keeping our code smaller and better.