tags:

views:

109

answers:

1

I'm learning about remoting by doing small remoting-based projects and also trying to enforce Good Practices while doing so to avoid my usual habit of developing Bad Habits.

There is a service that makes use of user-created plugins. Each plugin is isolated in its own appdomain. Additionally, there is a client application that connects to and interacts with the service.

There are channels for service-client communication and service-plugin communication, but nothing to facilitate plugin-client communication. As such, any object created by a plugin must be wrapped in a service-defined object before it can go through to the client (otherwise there is an exception due to lack of channel sinks).

If this makes sense, my question is this: should I continue this pattern or should I be creating channels between the plugin and client appdomains to allow plugin-instantiated objects to go to the client application?

Thanks for any education on the subject!

+3  A: 

I can't give you definite answer without hearing more about your application, so while the question is arguably subjective, here is my subjective reply:

It seems reasonable that the server aggregates connections to plugins, and the client only maintains a single channel to the server. This simplifies and consolidates the solution in a number of ways:

  • Access control only performed in the server
  • The plugin mechanism can me made transparent for the client
  • Simplified client all around
  • In the case of client and server being on distinct machines, you would probably prefer the client to talk only to the server and not directly with any plugins because it might require several connections/ports to be open at the server machine (for each plugin), this can become an issue if you have firewalls etc.

On the other side, it might be a hassle to envelope every plugin-object in a server-object.

Ron Cohen
Your point regarding distinct machines and firewalls was one I did not consider. Wrapping each object in a server object _would_ be a tremendous hassle, but it will also be a nightmare trying to coordinate an unknown number of possibly used ports.
oakskc