Comparison between MVC and three-tier architecture

Source: Internet
Author: User
I. Basic Definitions of various nouns

 

1. Understand ASP. NET

 

ASP is a server-side scripting technology that enables scripts embedded in web pages to be executed by Internet servers.

ASP. NET is the latest version of ASP (Microsoft dynamic server web page technology.

ASP. NET is an integral part of the Microsoft. NET Framework.It is also a powerful tool for creating dynamic interactive web pages.

The. NET Framework is the basic structure of the Microsoft. NET platform.

The. NET Framework is used to build, develop, and run web applications.ProgramAnd a web service environment.

The. NET Framework contains public language runtime libraries and public class libraries such as ADO. net, ASP. NET, and Windows Forms-to provide advanced standard services that can be integrated into various computer systems.

 

2. Understand MVC

 

MVC is a comprehensive application of multiple modes and should be regarded as an architecture mode (an architecture mode can often be divided into multiple design modes for joint use ).

MVC includes three types of objects. model is an application object, and view is its representation on the screen. controller defines the response method of the user interface to user input. If MVC is not used, these objects are often mixed in the user interface design, while MVC separates them, which improves flexibility and reusability.

 

3. Understand the three-tier architecture

 

A three-tier architecture generally divides the entire business application into a presentation layer (UI) and a business logic layer (BLL) data access layer (DAL ).

 

4. Understand ASP. NET MVC

 

ASP. net mvc is an easy-to-be-tested framework developed by Microsoft's development team based on MVC.

 

Ii. Differences between MVC and L3 Architecture

 

1. Similarities:

 

WithSame Design PhilosophyThat is, the view design and data persistence are separated to reduce coupling, facilitate expansion, and improve team development efficiency.

 

2. Differences:

 

Layer A and Layer 3 are based on business logic, while MVC is based on pages;

 

B. MVC is a composite design mode and a solution. Layer 3 is a software architecture that implements programming through interfaces.

The three-layer mode is the architecture mode, while the MVC mode is the design mode. The three-layer mode can be attributed to the deployment mode, and the MVC can be attributed to the presentation mode;

 

C. The three-tier architecture has different focuses on the MVC design model. The three-tier architecture is a general architecture concept with no restrictions on specific design. MVC gives a more detailed description of its design method;

 

D. Model is also mentioned in Layer 3, but the concept of Model in Layer 3 architecture is different from that in MVC. The typical model layer in Layer 3 architecture is composed of entity classes, in MVC, it is composed of business logic and access data;

 

E. Use graphs to represent the relationship between them.

 

3. Implementation

 

A. Implementation of layer-3 architecture on different platforms

 

The layer-3 structure has little to do with the language, and the structure design is the same. They only use different language libraries and methods on different platforms.

In Java, the presentation layer (front-end) can be implemented using JSP and flex. The middle layer uses J2EE servers and runs on tomcat or JBoss. The data layer can be implemented using hibernate.

. Net, the front end is ASP, and the middle layer is written in C # and other languages.

 

B. Implementation of MVC on different platforms

 

Similarly, the design of the MVC pattern will not change, but there are different specifications on different platforms.

On the Java platform (J2EE)

Unlike other frameworks, J2EE defines a specification for Model objects.

Swing is a standard MVC structure. componentui represents view, which is used to describe components, especially the model layer.

On the. NET platform

In ASP. NET, views and controllers are not well defined. The model is left for developers to design.

In ASP. net MVC, normally, the model is usually matched with the LINQ to SQL class (the dbml file created using the O/R designer tool) or ADO. NET Entity Data Model for implementation.

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.