"Plugin" type logic that uses two assemblies

I'm working on a migration tool. I have two different assemblies one is Mapping that is used to collect data and store it in predefined types (say Customer , Product etc). That assembly is instanced in the Engine using reflection and the data is migrated to a destination platform (on a pretty hard coded way, we're having methods like MigrateCustomers and such).

I'd like to rewrite the application so it's more generic, allowing clients to (for example) extend our Product class, and inject logic into both assemblies. If it were only one I would make an interface, add Execute() method and it would be simple. (something like command pattern).

The problem is I need two make sure both assemblies use the same "plugin" - one part defines logic for getting the data the second for importing the data.

Is there a pattern that deals with similar issues?


The patter to deal with this is called: Inversion of Control(IoC). You can refer these article for details:

  • Inversion of Control Containers and the Dependency Injection pattern
  • Inversion of Control vs Dependency Injection
  • Managed Extensibility Framework is based on IOC, if you want to implement a small plugin framework, you can follow the IoC pattern and do it your self; if you want to a framework with lots of features, you should use MEF.

    链接地址: http://www.djcxy.com/p/82200.html

    上一篇: 在java中的动态代理与脚本

    下一篇: 使用两个组件的“插件”类型逻辑