Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is MVC RESTful by design

Does MVC have to be RESTful?

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

but in doing so, that's no longer MVC pattern. (that's right isn't it?)

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?

like image 952
Seph Avatar asked Feb 14 '12 10:02

Seph


People also ask

Can MVC be RESTful?

ASP.NET MVC is one such framework that provides an inherently RESTful model for building XHTML-based services.

What is the difference between MVC and REST API?

MVC is about how the inner side of your app works. REST is about how your app "talks" with other apps. You can combine them.

What is the main advantage of the MVC design pattern?

A major advantage of the MVC pattern is that it simplifies the testing process by a great deal. It makes it easier to debug large-scale applications as multiple levels are structurally defined and properly written in the application. Thus making it trouble-free to develop an application with unit tests.

What is RESTful design?

REST or RESTful API design (Representational State Transfer) is designed to take advantage of existing protocols. While REST can be used over nearly any protocol, it usually takes advantage of HTTP when used for Web APIs.


1 Answers

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 is a protocol for interfacing with the application, which can be implemented using MVC.

In MVC the request goes into the controller, which creates a model for the view.

Request -> [Controller] -> Model -> [View] -> Response
like image 89
Guffa Avatar answered Sep 28 '22 16:09

Guffa