Software design hierarchy

Source: Internet
Author: User

Software design hierarchy is currently a programming model. In my opinion, it is mainly for the convenience of system maintenance and the advantages of object-oriented. Currently, the three-layer structure is popular, that is, the data access layer, business logic layer and presentation layer.

Here is a simple VC example:


The presentation layer is what we call the interface layer. The interface layer has many controls. Generally, the interface layer does not process any business. It only tells you how to do this, for example, if a user logs on to the system and clicks the login button on the interface, the button control does not execute any business-related functions, these are all handed over to the business logic layer, where the business logic layer executes the login System Business (Here we assume that the data we log on to the system is obtained from the database ), first, it needs to obtain the data of the login system. The business logic layer does not do this, and all the data is handed over to the data access layer for retrieval from the database, the data access layer returns the obtained data to the business logic layer, so that the business logic layer can execute the login System Service. Whether the login system is successful or not is displayed in the presentation layer for users.

To obtain data from a database, the interface layer (presentation layer) must first request the business logic layer and the business logic layer request the data access layer.

Three-tier development follows the following principles:

The upper layer depends on the lower layer, and there is no cross-layer dependency between them;

The next layer cannot call the previous layer;

The next layer can depend on the previous layer;

The previous layer cannot depend on the concept of the next layer;

MVC Framework

The full name of MVC is Model View Controller, short for Model-View-controller. It is a model of software design, this method is used to organize code by separating the business logic and data display. The assumption of this method is that if the business logic is clustered into a component, in addition, the interface and user interaction around data can be improved and customized without re-writing the business logic. MVC is uniquely developed to map the traditional input, processing, and output functions in a logic.

MVC first exists in the desktop program, M is the exponential data model, V is the user interface, and C is the controller. The purpose of MVC is to separate the implementation code of M and V, so that the same program can use different forms of representation. For example, a batch of statistical data can be represented by a column chart and a pie chart respectively. The purpose of C is to ensure synchronization between m and V. Once M changes, V should be updated synchronously.

Related Article

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.