转向MVC。对建筑的澄清 [英] Moving to MVC. Clarifications on Architecture

查看:69
本文介绍了转向MVC。对建筑的澄清的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前的应用程序具有以下架构



1)Web.UI层(Just CodeBehind方法)

2)业务图层作为单独的虚拟目录托管并公开为WCF服务

3)数据访问层(作为单独的程序集)



现在我需要设计并考虑将其移动到MVC4。这是否意味着UI将再次分为MVC,从而*不同*实体的总数现在将变为



1)V

2) M $ / $
3)C

4)业务层

5)数据访问层



或者我们应该对结构进行其他重新定位吗?有人可以帮助澄清一下吗?

解决方案

请参阅我的笔记。你的问题是你可能误解了整个建筑的概念。您尝试使用多个图层将其缩小到一个级别并将其全部表示为图层列表的另一个问题。更糟糕的是,你将多层架构的元素与MVC的元素混合在一起,甚至在同一层上。



我喜欢考虑因素在回答用户解释正交架构元素的想法的用户回答中的类似问题时,请参阅:

http://stackoverflow.com/questions/2690707/does-mvc-replace-traditional-manually-created-bll [ ^ ] 。



参见:

http: //en.wikipedia.org/wiki/Multitier_architecture [ ^ ],

http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller [ ^ ],

http://en.wikipedia.org/wiki/Orthogonality [ ^ ]。



-SA

I have my current application with the following architecture

1) Web.UI layer (Just CodeBehind Approach)
2) Business Layers hosted as a separate virtual directory and exposed as WCF services
3) Data Access Layer (as a separate assembly)

Now I need to design and consider moving the same to MVC4. Does that mean UI would again trifurcate into M V C thereby the total number of *distinct* entities would now become

1) V
2) M
3) C
4) Business Layer
5) Data Access Layer

or should we do some other re-orientation of the structure? Can some one help clarify the same?

解决方案

Please see my notes. Your problem is that you probably misunderstand the whole notion of architecture. Another problem that you try to reduce it to one level with several layers and represent it all as a list of layers. Worse, you are mixing the elements of multitier architecture with the elements of MVC, and even on the same layer.

I like the considerations provided in response to similar question in the answer by user151323 who explains the idea of orthogonal elements of architecture, please see:
http://stackoverflow.com/questions/2690707/does-mvc-replace-traditional-manually-created-bll[^].

See also:
http://en.wikipedia.org/wiki/Multitier_architecture[^],
http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller[^],
http://en.wikipedia.org/wiki/Orthogonality[^].

—SA


这篇关于转向MVC。对建筑的澄清的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆