是REST风格的MVC设计 [英] Is MVC RESTful by design
问题描述
MVC是否必须REST风格?
Does MVC have to be RESTful?
有没有一种方法,使 SOAP
使用 MVC
模式服务?
Is there a way to make a SOAP
service using MVC
pattern?
请问输入请求实际上进入查看
,然后再进入控制器
则型号
例如:
Would the input request actually go into the View
first and then into the Controller
then the Model
eg:
Request -> View -> Controller -> Model
但这样做,这是不再MVC模式。 (这是正确的,不是吗?)
but in doing so, that's no longer MVC pattern. (that's right isn't it?)
要不然我们得到使用 SOAP
,但仍坚持(或接近)的 MVC
格局。 MVVM会更适合的模式,这种情况在所有的呢?
How else would we get a typed response using SOAP
but still adhere to (or be close to) the MVC
pattern. Would MVVM be more suitable pattern to this situation at all instead?
推荐答案
REST介绍了如何接口与应用程序,而MVC是如何实现的应用程序。使用MVC可以REST风格或不是一个应用程序来实现。
REST describes how you interface with the application, while MVC is how you implement the application. An application implemented using MVC can be RESTful or not.
SOAP是一个协议,用于与应用程序,它可以使用MVC来实现接口
SOAP is a protocol for interfacing with the application, which can be implemented using MVC.
在MVC请求进入控制器,它创建了一个模型视图。
In MVC the request goes into the controller, which creates a model for the view.
Request -> [Controller] -> Model -> [View] -> Response
这篇关于是REST风格的MVC设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!