views:

57

answers:

1

A little background

I'm working on an .net application that's uses plugins heavily, the application can request data from the plugins that is then sent back and displayed by the application.

First I implemented the plugin framework in MEF but feel that it was a bit limited for my purposes, I wanted to be able to isolate plugins and have some versioning and licensing support (since plugins can be written by thirdparty).

Then started looking at MAF which seems support just those scenarios, however I can see one thing that might be a problem, before I invest too much time changing everything to MAF it would be great knowing if someone has experience with this issue since I havent worked much with MAF.

The problem

Currently when data is sent back to the application you get the actual objects of the data along with an adapter that says which fields the object contains and you can use the adapter on the object to extract the fields you want. The good thing about this is that you don't have to generate any new results objects but can simply query the results data when you want it from each object.

Now with MAF there's the Appdomain issue, I can't freely send all the objects across the app domain and inheriting from marshalbyref for each object isn't viable.

I could generate a result object with the string fields for each object but from a performance standpoint it doesnt seem such a good idea, the interface might only show 10 of hundreds of objects so it seems smarter to do on demand.

The solution I'm thinking might work is generating a sequence of just object id's and let the interface fetch the fields from the plugin through the appdomain through a proxy. So the application says for instance it wants fieldname x from items [y] in the plugin and those strings is sent across the appdomain.

The Question

So my questions are, is this a good way to do it, is there a better way? I'm obviously going to take a little performance hit moving across the appdomain still but since it's on demand and only for a small number of objects it shouldn't be too bad right? How do I go about setting up a proxy object like that?

It's not the easiest question in the world to answer, sorry. I'll really appreciate any insight, the future of the plugin architecture depends on it :)

A: 

It's probably memory mapped files will help you. You could send messages across domains and place data in memory mapped files or a single file, it depends.

But, honestly, Remoting over IpcChannel seems preferable...

Dmitry Karpezo
I don't think that'll work with the architecture since the application doesnt know how the data is stored and sometimes it isnt stored at disk at all. I guess remoting over ipc is possible but doesnt addin's contain a mechanism for things like this? The proxy idea if possible seems more architectually clean
MattiasK