WCSF vs MEF, What's Best For Me?
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?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).
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
精彩评论