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?
ASP.NET MVC is one such framework that provides an inherently RESTful model for building XHTML-based services.
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With