Three-tier architecture vs. MVC & Design Patterns

Source: Internet
Author: User

just learned three-tier architecture But as you learn in depth Span lang= "en-US" style= "Font-family:calibri" >mvc things I heard it early in design mode. mvc, Just a quick look at what that means. Now just put these three things together and talk about

Three floor

is a layered software architecture design that can be applied to any project.

it is from the perspective of the entire application architecture Divide the program into three layers ui layer ,BLL layer ,dal layer ( of course If the program requires, you can also split multiple layers). Layer three is designed to solve the problem of code encapsulation at different stages of a business operation throughout the application, in order to enable programmers to focus on the business logic at a particular stage. For example, the database operation code is encapsulated in a layer, providing some methods to directly return the corresponding data according to the parameters of the user, so that when dealing with the specific business logic, there is no need to care about the data storage problem.

See

http://blog.csdn.net/u010028869/article/details/24711163

Mvc

The full name is Model Viewcontroller, which is the abbreviation for models-View-Controllers (Controller), a software design paradigm,

It is mandatory to makeApplicationof theinput,processingand theOutput separate. Using an MVC application is divided into three core parts: Model,View,Controller. Each of them handles their own tasks.

Model (model) is the part of the application that handles application data logic.

Typically, model objects are responsible for accessing data in the database.

View (view) is the part of the application that handles the display of data.

Typically views are created from model data.

Controller (Controller) is the part of the application that handles user interaction.

Usually the controller is responsible for reading data from the view, controlling user input, and sending data to the model.

MVC tiering helps to manage complex applications because it can be make us focus on one aspect within a single time. For example, you can focus on view design without relying on business logic. MVC also makes it easier to test your application.

MVC and three-tier architecture it's different.

( as far as surface knowledge is concerned )

the three-tier architecture is the interface layer (UI) Business Logic layer (BLL) and the data Access layer (DAL) constituted, andMVCis the model layer (M) interface Layer (View) and the control layer (Controller), and they are notis one by onecorrespondingof the.

If you want to give them a hard match, then the three-tier architectureUIcorrespondingMVCin theView(JSP), which are used to display and obtain the interface data; In a three-tier architecture,BLLlayers andDALLayer CorrespondenceMVCin theModel(JavaBean) layer is used to process the data from the upper layer and the data obtained from the database;MVCin theController(Servlet) up to three-tier architectureUIPart of it, and that's what we always sayServlet.

As shown in the following:

MVC and three-tier architecture is the same

( for their purposes )

Why did the pioneers design MVC and three-storey architecture. ? They have this common goal. !---- layering, decoupling!

from the decoupling point of view, the three-tier architecture and MVC In fact, they are consistent, but the division of the method is not the same. It 's like steamed buns and noodles, they're different on the surface but their core is the same, they're all noodles ...

Three Floor &mvc the battle with design patterns

First MVC Not design mode , It's at the same level of architecture as the three layers. , is an architectural pattern .

MVC Frame Although similar to the design pattern, it is fundamentally different. The design pattern is a description of the recurring problem in an environment and the solution to the problem, which is more abstract than the framework, the framework can be expressed in code, can be directly executed or reused, and only the instance can be represented in code for the pattern ; design patterns are smaller elements than frames, and a framework often contains one or more design patterns, which are always targeted at a particular application area, but the same pattern can be applied to a variety of applications.

In summary : Framework is a great wisdom for the division of Software design, design mode is a small skill, to solve specific problems, to improve code reuse rate, reduce coupling degree.

Although MVC study hasn't started yet. , Get in touch with the first , Please correct me where there is any mistake. !

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.