Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Server side MVC +Client side MVC

An application is both JS intensive and has a complex business logic +huge data flow that uses backboneJS to structure JavaScript code and there is a necessity for the server side MVC also (Spring in this case).

  1. Is it a good idea to implement server side MVC (spring ) along with client side MVC (backbone) and are there any compatibility issues between them?
  2. In case both can be implemented.How am i going to coordinate the spring views with the backbone view.
  3. How will client side MVC with template engine collaborate with 'View' of Spring.

Though this question has been asked before, I could not find suitable answer for this. Can somebody help me with a detailed answer?

like image 599
LongInt Avatar asked May 16 '12 10:05

LongInt


People also ask

Is MVC server-side or client-side?

ASP.Net MVC is a server side framework.

What is client and server in MVC?

The client is the computer, which asks a server, another computer, for information. The server answers to this question and sends the answer as data to the client. The client displays this answer on his screen for the user. This is more how hardware works. MVC is a programming technic.

What is MVC server-side?

ASP.NET MVC (Server-side) With MVC, all the grunt work is done on the server and the browser is given straightforward HTML to render. The user attempts to navigate to a URL in the browser. The browser pings this requests over to the server. ASP.NET MVC takes over, forwards the request to the relevant controller.

What is client-side and server-side validation in MVC?

Client side validation Vs server side validation The user input validation take place on the Server Side during a post back session is called Server Side Validation and the user input validation take place on the Client Side (web browser) is called Client Side Validation.


2 Answers

This article describes how to make an application architecture with both server side MVC and JS MVC , respecting the MVC pattern. http://blog.javascriptmvc.com/?p=68

like image 40
Abdeslem Menacere Avatar answered Sep 23 '22 16:09

Abdeslem Menacere


Backbone.js is primarily used for SPA's (Single Page Applications). Your backbone.js segments ('views') are rendered and re-rendered by data, that is fetched or changed. If your application is going to be javascript intensive, backbone is a great minimal framework that will help organize your application. However, backbone is not so simple when your javascript application becomes quite large. You have to have a thorough understanding of the fundamentals of javascript and have a programming decided pattern. Otherwise you application can become quite a mess even with the use of backbone.js.

Anyhow I digress. Think of you client side application (backbone.js driven) completely separate from your server side application (MVC driven). All your client application needs from your server application is the data. That is why backbone.js is built around a REST API. If you are looking to develop a large javascript application, I would look at using MVC 4's Web API for your REST API, and backbone.js to help organize and standardize your client application.

like image 120
TYRONEMICHAEL Avatar answered Sep 25 '22 16:09

TYRONEMICHAEL