What is three-tier architecture and MVC?

Source: Internet
Author: User

Sho Jichao
Links: https://www.zhihu.com/question/24291079/answer/27339010
Copyright belongs to the author. Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source.

In enterprise application development, three layers of architecture are often used: presentation layer, business layer, persistence layer .

    • The presentation layer is responsible for receiving requests, forwarding requests, displaying data, and so on;
    • The business layer is responsible for organizing the business logic;
    • The persistence layer is responsible for persisting the business object.

These three tiers, each with a different pattern, is the architectural pattern. The most common architectural pattern for the presentation layer is MVC. Therefore, MVC is the most common architectural pattern in the presentation layer in a three-tier architecture.

It is recommended to read the classic books such as "Enterprise Application Architecture Model", "Domain Driven Design", "POJOs in Action", "the core pattern of Java EE", and do not invent nouns arbitrarily.

MVC-Models, views, controllers.

There's always someone here. Model layer, view layer, controller layer, where do you get so many layers? Do you want to have a service layer, DAO layer, and DTO layer?

XX layer, English is tier (physical), layer (logically). As a layer, personal understanding has the upper and lower relations.

Model, view, controller have the upper and lower relation? Otherwise dependent on the reversal principle (the upper level does not depend on the lower layer, both of which are dependent on abstraction) what does it mean?

Three-tier architecture, each with its own pattern. Pattern is the routine (Yang Taijiquan 18 style is the routine), each layer has its own routines, is the so-called architecture model .

    • The most common pattern for presentation layers is MVC, which is an architectural pattern of presentation layers.
    • The business layer architecture pattern has transactional scripting patterns, domain model patterns, CQRS , etc. (another is anemia, blood loss, congestion, swelling ...). )。
    • The schema pattern of the persistence layer is the ingress mode, the data mapper mode , and so on.

In general, Frame > Architecture patterns > Design Patterns > Design principles. To make an analogy,

    • Hibernate is a persistent layer framework , is the implementation of the data mapper model , the implementation of the factory model, and many other design patterns , reflecting what depends on the reverse principle, open and close principle, the Richter replacement principle, etc. Design principles .
    • Angularjs is a client-side MVC framework, which is an implementation of the MVC architecture pattern, which is implemented using the XXXX design pattern, which embodies the design principles of XXXX.
    • Struts,asp . NET MVC is the presentation layer framework ..... Such.

What is

Three-tier architecture and MVC?

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.