views:

148

answers:

2

I've got an application with 2 main components + other DLLs:

  1. Core DLL (got all core functionality)
  2. GUI
  3. 3rd Party and Totally Independent DLLs which requires for DI etc.

Now I'm implementing plugin support.

Which DLL should be responsible from loading these plugins? GUI or the Core DLL?

I'm using MEF so not quite sure where to stick it.

A: 

I would think Core DLL, as it is probably business logic that will be plugins.

MasterMax1313
+2  A: 

I think that the answer depends on how the Parts (using MEF terminology) are being used by within the application. I would create and fill the containers according to where/how the parts are being leveraged.

Example:

If you are creating parts that contain views for the GUI I would think that the GUI layer in the application would load them and manage the container.

I have an application framework that I built for client app plug-ins and in it there is a static application manager class that loads Parts for the application, but then I also load Parts into a container that is used by my core logic. The intent of the two is completely different because some of them are core concepts that I wanted to be able to easily swap out later and some are UI plugins that extend client functionality when they are dropped in and available to the app.

Also, these are loaded using different approaches... the core is only at start up using specific rules and the other is loading everything from a directory (plugins).

Brian ONeil