0

我们开发了一种产品(核心)。我们扩展和覆盖 Core 中的功能以创建定制应用程序(产品)。

Product 具有对 Core 的引用,因此它可以从基本表单继承并覆盖功能。

MEF 在这里会有优势还是更适合插件?

4

1 回答 1

1

I think that MEF would be an advantage for you. MEF can be for plugins or just for applications that are "composed" at run-time.

In your case, your core could search for Product and instantiate it at runtime. This means that while Product still needs a reference to Core, your application launch point only needs a reference to Core, not to Product. I assume right now that the user has to execute Product.exe, which then calls into Core.dll to start everything up. Using MEF, the user would run Core.exe and it would load contracts from Product.dll. The architecture would be cleaner.

于 2009-06-15T02:51:37.723 回答