Can i say that MVP = 3 Tier Archi?

前端 未结 3 1802
囚心锁ツ
囚心锁ツ 2021-01-22 14:41

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 follo

3条回答
  •  一个人的身影
    2021-01-22 15:37

    You will see in answers such as this What are MVP and MVC and what is the difference? That MVC and MVP are addressing the structure of the code concerned with UI. They address questions such as:

    • Which component understands the user's actions?
    • Which component decides what view to present next?
    • What is the relationship between View and Model?

    Neither MVC nor MVP go into details of what's inside (or beneath) the Model. In some systems the Model is comparatively simple, just a thin skin on top of a database, in other systems there's an awful lot of logic down there, for example integration with Enterprise systems such as SAP and CICs.

    In its traditional meaning a 3-tier architecture (or more generally an n-tier architecture) puts additional structure inside the Model.

    This wikipedia article discusses MVC v n-tier architectures. I think it's reasonable to substitute MVP for MVC in this article.

    As to your application's architecture: my perception is that modern apps tend to have a rich UI presented in the browser, using simple REST services supplied by a Model on some server and then some arbitrarily complex stuff in the model. I guess you can see this as an n-tier architecture. The interesting thing is that as you structure your Javascript (JQuery, Dojo or whatever) in teh browser you find design patterns coming out, and an MVC pattern actually can emerge purely in the presentation tier.

提交回复
热议问题