N层架构和MVC [英] N-Tier Architecture And MVC

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

问题描述

我是MVC的新手.

我有个疑问.目前,我正在asp.net中的N-Tire架构上进行项目,其中有一个Web应用程序层,业务逻辑层,数据访问层,接口层和一个模型.

上面所说的东西使代码真正独立.

该模型与我们在MVC中使用的模型相同,此处用于数据流.

因此,我的问题是上面指定的ntire模型和MVC之间有什么区别.

I am new to MVC.

I have a doubt. Presently i am doing projects on N-Tire architecture in asp.net where there is a webapp layer,Business Logic Layer, Data Access Layer, Interface Layer and a Model.

The above said thing makes the code really independent.

The Model is same as we use in MVC, it is used here for data flow.

So my question is what is the difference between the above specified ntire model and MVC.

推荐答案

N层体系结构通常使每个层都被网络分隔开. IE.表示层位于某些Web服务器上,然后通过网络与后端应用程序服务器进行业务逻辑对话,然后又通过网络与数据库服务器进行对话,也许该应用程序服务器还调出了一些远程服务(例如Authorize.net进行付款处理).

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

N层只是指实现的物理结构.这两个有时会混淆,因为MVC设计通常是使用N层体系结构实现的.
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 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-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.


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

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