My view on the difference between MVC and three-tier architecture

Source: Internet
Author: User

I was just learning about MVC and the three-tier architecture, and I learned a little bit about MVC and the three-tier architecture, and I'll talk about the difference between MVC and the three-tier structure. If there is anything wrong, please point out, thank you!

All right, get back to the chase.

First of all, we can first logically differentiate, for example: To take a house, three-storey architecture is like the basic structure of the house, MVC is like your ideal house design .

Next, I'll talk specifically about the three-layer structure and MVC ...

(i) three-tier architecture

1. The usual three-tier architecture is to divide the entire business application into: presentation layer (UI), business Logic Layer (BLL), data Access Layer (DAL).

2, the purpose of distinguishing levels is to "high cohesion, low coupling" thinking.

3, the presentation layer (UI): Generally speaking is to show the user something, the user can see the interface, video, audio, etc., that is, the user operating system when the WYSIWYG.

4, Business Logic Layer (BLL): It is not literally difficult to understand, is the business needs of the functions and requirements of processing, and to interact with the database, so that the user needs data through the presentation layer in front of the user.

5, data Access Layer (DAL): This layer is responsible for the operation of the database, including the data additions and deletions of this and query operations.

(ii) MVC

1. The full name of MVC is the Model View controller, which is the abbreviation for models-Views (view)-Controllers (Controler) .

2, MVC is a model of software design, used to organize code with a business logic and data display separation method.

3, Model: is a business provider, determines the functionality provided by the software, its internal may be some ordinary class or implement a function of the interface, etc.

4, view: Is the user to see and can interact with some of the interface.

5, CONTROLLER (controler): is to handle the user's operation and feedback the final result to the user's desired interface of a set of operations.

Finally, let's look at the specific differences between them ...

From the above MVC and three-tier architecture, it is not difficult to find that MVC seems to be the UI layer from the three-tier architecture, in fact, strictly speaking MVC Model,view,controler These three add up is the UI layer in the three-tier architecture, that is, MVC again divides the UI layer in the three-tier architecture into a controller, a view, an entity three parts, the controller completes the page logic, and the interface layer completes the call through the entity, while the controler layer interacts directly with the BLL in the three layer.

We go back to the first example of the house, we can imagine: the three-layer architecture of the presentation layer is what you see your own design of the house, the business logic layer is equivalent to building the building needs of knowledge, the data access layer is equivalent to building the material needed for housing. MVC is the equivalent of the house you eventually built, and the model in MVC equals .... (hehe, the rest of you to think about ...) )

My opinion on the difference between the

MVC and the three-tier architecture

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.