1. Three-layer architecture understanding: The three-tier architecture typically divides the business into the data access layer (related to the data in the database), the business logic layer (operations on the database layer, the business's logical processing, and the protection of the data layer as the data security) and the display layer (presenting the information in front of the user);
2.MVC is a pattern of presentation.
Layer three is based on business and MVC is based on the page, MVC is mainly used for presentation layer, 3 layer is mainly used for architecture , 3 layer is generally the presentation layer, middle layer, data layer, wherein the expression layer can be divided into M, V, C, (Model View Controllers) Model-view-controller; MVC is the architecture of the presentation layer , and the model of MVC is actually viewmodel, the data that is presented for the view. ViewModel does not contain business logic, nor does it contain read data. M refers to the data model, v refers to the user interface, and C is the controller. The purpose of using MVC is to separate the implementation code for M and v so that the same program can use different representations, and C exists to ensure that M and V are synchronized, and that if m changes, V should be updated synchronously.
Note: The model in MVC can be directly correlated with view, not necessarily the controller to be the Middle bridge, the model in layer three does not include the reading of the data.
an important feature of MVC is separation, two types of separation:
The separation of the view and the data (model) uses different view to display the same data, separating the visible and invisible components and being able to test the Model independently. Because separating the visual components reduces the external dependencies to facilitate testing. (The database is also an external component);
The separation controller for view and presentation logic (Controller) is a component that behaves logically, not a business logic component. MVC can also be used as a modeling mode, meaning that this controller can also be a business logic. Separate logic and concrete presentation, allowing for independent testing of logic.
The layered pattern of the three-tier architecture is a typical up-down relationship, with the upper layer dependent on the lower. But MVC, as a performance model, does not exist in the upper and lower relations, but is a collaborative relationship. Even if MVC is used as an architectural pattern, it is not a layered pattern. MVC and the three-tier architecture are basically not comparable and are applied to different areas of technology.
Layer three can be applied to any language, any technology application, and MVC is just to solve the coupling relationship of the parts of the BS application View layer. They are non-conflicting, can exist at the same time, and can be used depending on the situation.
The difference between MVC and three-tier architecture