plug in, Basic idea

Refer to <C#插件构架实战>

1.      A common interface IPlugIn will be provided. For the host application, it will use this interface to provide necessary information to the plug-in components. For the plug-in component, it will implement this interface to let the host operate on it.

2.      A common interface of host application will be provided also. The plug-in component should be able to get this interface through IPlugIn, so that it can operate on the host application.

3.      When the application run, it will load the plug-in component files. Using the reflection technic, it will create the plug-in instance and get the interface IPlugIn. Then the host provides the interface of itself to the plug-in instance through IPlugIn. Then the plug-in instance can operate on the host now

Host load the plugin component files.

Host use reflection technic to create the plug-in instance, get the IPlugIn.

Host transfer its own interface through IPlugIn to the plug-in instance.

plug-in instance operate on the host through the interface it gets

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值