thecountofzero
thecountofzero

Reputation: 413

MVC or Rest or Both

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 solution, 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

Upvotes: 17

Views: 31353

Answers (4)

user2778261
user2778261

Reputation:

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.

Upvotes: 0

lbz
lbz

Reputation: 9738

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

Upvotes: 23

hisdrewness
hisdrewness

Reputation: 7651

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.

Upvotes: 3

ocodo
ocodo

Reputation: 30258

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.

Upvotes: 2

Related Questions