WCSF 与 MEF,哪个最适合我?
我正在开发一个大型 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这就是 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).
当我读到这个问题时,我想:出于多种原因,我会选择 MEF 并避免使用 SCSF
但是,这一切都不算数。 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
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