开发者

MVC or Rest or Both

开发者 https://www.devze.com 2023-02-07 05:43 出处:网络
I in the process of designing the server side of a web-based user interface that will be very JavaScript intensive.

I in the process of designing the server side of a web-based user interface that will be very JavaScript intensive.

I originally thought of going with an MVC s开发者_如何学运维olution, but now I am thinking I want to use a REST-based solution such as Jersey or Restlets.

Is this often an one or the other type decision or can they be a combined solution?

Thanks, Mike


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 lot of modern frameworks actually are MVC based and make implementing REST web services easy: Ruby on Rails, Java Spring Framework with SpringMVC , Django, Backbone.js


One of the best Java frameworks I've seen for building MVC webapps with the ability to support REST is SpringMVC. This blog post outlines the REST capabilities in SpringMVC since version 3.0. I've developed REST services using SpringMVC and Jersey, and they are fairly comparable.


They are patterns / solutions to solve different problems.

REST sanitises & simplifies addressing access to features of a web application, for users, client software, etc.

MVC provides a means to organise your application code, making it easier to maintain.


MVC is an architectural design pattern for the layers of your application.

The folder structure:

Models/YourClassModel.php
Views/Home/HomeView.php
Controllers/Controller.php
index.php

The application style REST is the Representational State Transfer of the application.

0

精彩评论

暂无评论...
验证码 换一张
取 消