MVC 与 n 层架构 [英] MVC Vs n-tier architecture

查看:28
本文介绍了MVC 与 n 层架构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道 MVC(一种架构模式)和应用程序的 n 层架构之间到底有什么区别.我搜索了它,但找不到简单的解释.可能我对 MVC 概念有点幼稚,所以如果有人能解释其中的区别,那就太好了.

I was wondering what exactly is the difference between MVC(which is an architectural pattern) and an n-tier architecture for an application. I searched for it but couldn't find a simple explanation. May be I am a bit naive on MVC concepts, so if anyone can explain the difference then it would be great.

干杯

推荐答案

N 层架构通常每层都由网络分隔.IE.表示层在一些 Web 服务器上,然后通过网络与后端应用服务器进行业务逻辑对话,然后与数据库服务器对话,再次通过网络,也许应用服务器还调用一些远程服务(比如Authorize.net 用于支付处理).

N-tier architecture usually has each layer separated by the network. I.E. the presentation layer is on some web servers, then that talks to backend app servers over the network for business logic, then that talks to a database server, again over the network, and maybe the app server also calls out to some remote services (say Authorize.net for payment processing).

MVC 是一种编程设计模式,其中代码的不同部分负责表示某些应用程序中的模型、视图和控制器.这两件事是相关的,因为例如模型层可能有一个内部实现,它调用数据库来存储和检索数据.控制器可以驻留在网络服务器上,并远程调用应用服务器来检索数据.MVC 抽象了应用程序架构如何实现的细节.

MVC is a programming design pattern where different portions of code are responsible for representing the Model, View, and controller in some application. These two things are related because, for instance the Model layer may have an internal implementation that calls a database for storing and retrieving data. The controller may reside on the webserver, and remotely call appservers to retrieve data. MVC abstracts away the details of how the architecture of an app is implemented.

N 层只是指一个实现的物理结构.这两者有时会混淆,因为 MVC 设计通常使用 N 层架构来实现.

N-tier just refers to the physical structure of an implementation. These two are sometimes confused because an MVC design is often implemented using an N-tier architecture.

这篇关于MVC 与 n 层架构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆