WCSF 与 MEF,哪个最适合我?

发布于 2024-08-28 16:38:27 字数 381 浏览 8 评论 0原文

我正在开发一个大型 Web 应用程序,其中包含许多模块(CRM、库存、管理等)。我想要完成的是能够独立开发每个模块(UI、核心逻辑、数据访问逻辑以及所有模块)。 ),然后将它们全部集成到一个核心模块中(这种集成应该只是配置文件中的更改)。例如,如果我有一个名为 Host 的核心模块,我应该能够通过简单地将这一行添加到主机的配置文件中来将 CRM 模块添加到主机模块中:

<模块名称=“CRM”/>

我阅读了 WCSF,发现它可以帮助将一些模块集成在一起,但在集成这些 UI 元素方面它确实没有提供太多帮助。
有些朋友建议使用 MEF 来完成这项工作,但我还没有看过。
你们觉得怎么样?
是否有可能实现这种级别的模块化?我需要投入多少工作才能使其正常工作?

I'm working on a large web application that includes many modules (CRM, Inventory, Administration, etc.) What I want to accomplish is to be able develop each of these modules independently (the UI, Core Logic, DataAccess Logic, and all) and then integrate them all together into a core module (this integration should only be a change in the configuration file). For example, if I have a core module named Host, I should be able to add the CRM module to the host module by simply adding this line to the host's configuration file:

<module name="CRM" />

I did some reading on the WCSF, and found that it can help integrate some modules together, but it really doesn't offer so much help in terms of integrating those UI elements.
Some friends suggested MEF for the job, but I haven't looked at that yet.

What do you guys think?
Is it possible to achieve this level of modularity, and how much work do I have to put into it to get it working?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

芸娘子的小脾气 2024-09-04 16:38:27

这就是 MEF 所做的事情,并且随着它成为 .NET 4 中 BCL 的一部分,我肯定会采用它(请注意,它也以 .NET 3.5 SP1 的开源形式提供)。

但是,不要指望任何工具能够让您神奇地开发松散耦合的代码。它首先是一门设计学科。您还可以使用常见的依赖注入和插件模式编写模块化应用程序,只使用基本的 BCL(尽管 DI 容器会很有帮助)。

That is what MEF does, and as it becomes a part of the BCL from .NET 4, I would definetely go with that (note that it's also available in open source form for .NET 3.5 SP1).

However, don't expect any tool to enable you to magically develop loosely coupled code. It is first and foremost a design discipline. You can also write modular applications using common Dependency Injection and add-in patterns using nothing but bare-bones BCL (although a DI Container would be helpful).

烟酒忠诚 2024-09-04 16:38:27

当我读到这个问题时,我想:出于多种原因,我会选择 MEF 并避免使用 SCSF

  • MEF 实现起来非常轻量,尤其是与 WCSF 相比
  • WCSF 有很多入门要求
  • WCSF 给典型操作增加了不必要的复杂性
  • MEF 有很多选项已经准备好模块
  • Glen Block(MEF 之父)太棒了!
  • Glen 始终致力于让 MEF 变得更好、“更简单”、“更强大”。
  • MONO 的家伙也尝试使用 MEF
  • WCSF 是 WF 1(不是 WF 4,这不是最近的问题,而是 WF 1 中的许多问题)

但是,这一切都不算数。 WCSF 和 MEF 不同。这个争论对我来说听起来不正常。

对于您所追求的,例如 WCSF 正是为此而设计的。 MEF 用于每个模块内部的功能,例如,如果它更好的话。

你喜欢 MVC 吗?您是否考虑过 MVC 2.0(现在为 RTM)Areas 功能?

编辑:
请参阅这个由 5 部分组成的系列:
http:// blogs.msdn.com/simonince/archive/2008/06/19/wcsf-application-architecture-5-defining-modules.aspx

编辑2
此链接对 IoC(这似乎就是您如何看待 MEF)和 WCSF 之间的讨论进行了大量讨论:
http://theniceweb.com/?cat=45

When I read the question I think: I'd go with MEF and avoid SCSF for many reasons

  • MEF is very light weight to implement, especially vs WCSF
  • WCSF has so many requirements to get started
  • WCSF adds unneeded complication to typical operations
  • MEF has many options already for picking up the modules
  • Glen Block (the father of MEF) rocks!
  • Glen is always getting MEF better and "easier" and "more powerful" at the same time.
  • MONO guys also try to play with MEF
  • WCSF is WF 1 (not WF 4, and it's not about how recent, but many issues in WF 1)

However, this all doesn't count. WCSF and MEF are different. The argument doesn't sound normal to me.

For what you are after for example WCSF is meant exactly for that. MEF is for the functionality inside each module for example if it's better.

Are you into MVC? Have you considered MVC 2.0 (RTM now) Areas features?

Edit:
See this 5 part series:
http://blogs.msdn.com/simonince/archive/2008/06/19/wcsf-application-architecture-5-defining-modules.aspx

Edit2
This link makes a very good deal of the discussion between an IoC (which seems to be how you see MEF) and WCSF:
http://theniceweb.com/?cat=45

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文