本文介绍了我可以说,MVP = 3层阿尔奇?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从过去的几天我一直在寻找我的新的Web应用程序,这将在ASP.Net使用C#来devloped的最佳架构。到现在为止,我只发现和研究以下3


  • 三层结构体系(注意:
    一级我的意思是逻辑层)

  • 模型 - 视图 - 控制器(MVC)

  • 模型视图presenter(MVP)

现在folling是我的问题:

1)据我了解3层架构和MVP我可以说,MVP和3层都是
    一样的东西?如果不是,则是什么bewtween两个不同? (注:我只找
    MVC和MVP或MVC和3层建筑导,但没有人之间的差异ADRESS的差异
    MVP和3层建筑导)之间

2)我只发现上述三种架构选择,是否有任何其他选项
    可以吗? (注:在这里,我只想对网络的整体架构的选项
    应用程序,像上述3)


解决方案

从软件架构的角度;我们用术语来讲,因为意味着什么。当你使用像三级的术语,你应该在哪里它适合它的预期和理解的含义使用它。各种各样的事情可以简单地通过具有某种三个分立元件被视为三梯队。但是,如果使用这个词来形容MVP,你会误导他人。为什么不能简单地说MVP?

3层一般是指三个物理层。 。

与关联图:

无论是MVP,也不排除MVC使用这三种物理层。事实上,只要你的压印为MVC应用程序(或MVP)的应用程序并没有真正明确多了。例如,它可以是MVC在服务器端(如在ASP.NET MVC)或者它可以是MVC上的Javascript,或在客户端侧

至于你关于建筑的选择问题;比赛场地为pretty开阔。您通常的选择取决于许多因素,你应该在你收集你的应用需求进行收集。

很多时候,你必须做一个权衡扩展性和复杂性之间。然而,一些新的技术使这种权衡可以忽略不计 - 我会建议任何人开始一个新项目来考虑他们认真(下面的一些讨论)

这几乎总是最好的,身体,专用数据层(SQL,蒙戈,天青,亚马逊,你挑),以及一个专用的,可扩展的,逻辑层(通常是在.NET土地实现的这些天,因为WCF服务)。

大多数时候的人加入他们的网站和逻辑层...但是这并不一定如此。有时是有意义的有一个物理层专为网络服务,只能通过你的网站访问层。再次,这是所有依赖的情况,。

至于逻辑层去(你的逻辑层内),它几乎总是最好有某种形式的数据访问层(DAL),同比IN- code模式(​​无论是手动实施,或者通过类似LINQ-到实体),和一个专用的商业逻辑层。

越来越多的这些天人们似乎回落到传统的HTML和Javascript(有东西像jQuery,原型,道场,等的帮助下),并使用REST / JSON与Web服务的聊检索和显示数据在客户端。在这种情况下,你可以在客户端上一个成熟的应用程序,并在后端的另一个完整的应用......每一个都有自己我上述的逻辑层的实现。

选项是敞开的。

From last few days i have been searching the optimal architecture for my new web application, which would be devloped in ASP.Net using C#. Until now, i only find and study following 3

  • Three Tier Architecture (Note: ByTier i mean logical layer)
  • Model View Controller (MVC)
  • Model View Presenter (MVP)

Now folling are my questions:

1) As far as i understand 3 Tier Architecture and MVP can I say that MVP and 3 Tier are the same thing? If not, then what is the difference bewtween both? (Note: I only find the difference between MVC and MVP or MVC and 3 Tier Archi but no one adress the diff between MVP and 3 Tier Archi)

2) I only discover above three architectural options, is there any other options available too? (Note: Here i want only the options for overall architecture of web application,like above 3)

解决方案

From a software architecture perspective; we use terms because terms mean something. When you use a term like "3-tier", you should use it where it fits it's intended and understood meaning. All sorts of things could be deemed "3-tier" simply by virtue of having three discrete components of some sort. But, if you used that term to describe MVP, you'd be misleading the other person. Why not simply say "MVP"?

3-Tier generally refers to three physical tiers. And Wikipedia has a great article on it here.

With the associated diagram:

Neither MVP nor MVC exclude using these three physical tiers. In fact, simply coining your application as an "MVC" application (or "MVP") doesn't really clarify much anymore. For example, it could be MVC on the server side (as in ASP.NET MVC) or it could be MVC on the client side with Javascript, or both!

As far as your question about architectural options; the playing field is pretty wide-open. The choices you make typically depend on a number of factors which you should be collecting while you collect your application requirements.

Often times you must make a trade off between Scalability and Complexity. However, a number of new technologies are making this trade off negligible - and I'd advise anyone starting a new project to consider them seriously (some discussed below).

It's almost always best to have, physically, a dedicated data tier (SQL, Mongo, Azure, Amazon, take your pick), and a dedicated, scalable, logic tier (usually implemented these days as WCF services in .NET land).

Most times people join their website and logic tiers... but this doesn't have to be the case. Sometimes it makes sense to have a physical tier exclusively for web services which are only accessible by your web site tier. Again, it's all situation-dependent.

As far as logical layers go (within your logic tier) it's almost always best to have some sort of data access layer (DAL), an in-code model (whether implemented manually, or through something like LINQ-to-Entities), and a dedicated business logic layer.

More and more these days people seem to be falling back to classic HTML and Javascript (with the help of things like JQuery, Prototype, DOJO, etc.) and using REST/JSON to chat with web services for retrieving and displaying data on the client side. In this scenario you can have a full-blown application on the client side, and another full-blown application in your back end... each with their own implementations of the logical layers I described above.

Options are wide open.

这篇关于我可以说,MVP = 3层阿尔奇?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 07:47