First of all, for adding plugins support to your app you can use Microsoft Extensibility Framework (MEF). If you're constrained to using .NET 2.0, then there are other custom ways for discovering and loading up plugins (through separate app domains, or by loading them straight to the primary app domain).
As for the design, I would make each plugin:
- Hold the service reference to it's particular web service instance.
- Make any particular assignments or logic to that service. For example assign
10
tostock.qty
. - Provide callbacks/events the application could use to interfere with the logic implemented in the plugin. For example, you could have the plugins expose an event called
BeforeStockSubmitted
and you could do some validation or checks in the app on the data being submitted to the service.
Your plugin host (the application, or a module of it) should:
- Expose a consistent object model for all plugins. You should offer a certain degree of abstraction for all entities the plugins will work with (such as
sessionId
,stock
, etc). - Data coming into the plugins should be abstracted as well. So you can have an
IStockInfo
interface in the host and each plugin should be constrained to provide their own implementation. The host can populate the common properties of these objects while the plugin takes care of the specific part.