Reputation: 564
In an effort to ensure we take the right approach in structuring our MEF plugins, there is a debate about whether it makes sense to have each plugin as a separate assembly.
For example, assume we have a DataProcessors solution and in it we begin to develop different processors for each of the different types of data files we receive. As each processor comes online, we want to be able to have the MEF catalog include this new plugin. However, we are concerned about having a solution with ~100 projects in it due to the performance hit in VS and in our build environment.
I think it makes sense to isolate each of these processors into a single assembly keeping the responsibility of that assembly finite. But there is a cost.
Does anyone have any experience with whether one approach would work better than the other?
Upvotes: 1
Views: 177
Reputation: 61589
There is no real right or wrong answer. You may decide that you can bundle multiple processors into the same assembly, or you could use a per-assembly approach. The later gives you maximum flexibility, but the former is probably more efficient when it comes to distribution.
I'd look at frequency of updates you intend to make, and perhaps organise them into groups of processors, around a common base data type or action.
E.g. I could have an assembly of integer processors, and another assembly of string processors.
As I said, there is no right or wrong way of doing this.
Upvotes: 0
Reputation: 8176
The situations I've had to deal with are slightly different to yours in that each of my projects contains a 'module' which contains a lot of functionality with many MEF exports. I generally only separate off into different assemblies if I intend on distributing them separately or plan to distribute different functionality to each client.
I don't think you should treat it differently to the decisions you make when organising your classes and assemblies without MEF. If you always release all of your products with all of these exports, include all of them in one assembly.
I would be very interested to hear others views though!
Upvotes: 2