Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is client side MVC and how is it implemented in JavaScript?

Recently gone through many articles explaining single page application. But i am very much confused about the architecture or rather how it works.

  1. There is some thing new called client side MVC implemented by using javascript. Till now i had seen server side MVC architecture. What is this client side MVC?

  2. Where does the client side MVC files are hosted. Is it hosted along with server files similar to typical web application.

  3. What is the role of server side java script like node.js.

  4. What is the flow from end to end.

like image 223
Adiant Avatar asked Sep 06 '13 08:09

Adiant


People also ask

What is MVC framework in JavaScript?

MVC frameworks are libraries that can be included alongside JavaScript to provide a layer of abstraction on top of the core language. Their goal is to help structure the code-base and separate the concerns of an application into three parts: Model - Represents the data of the application.

Is MVC used in JavaScript?

JavaScript now has a number of frameworks boasting support for MVC (or variations on it, which we refer to as the MV* family), allowing developers to easily add structure to their applications without great effort. These frameworks include the likes of Backbone, Ember. js, and AngularJS.

Is MVC client side or server side?

ASP.Net MVC is a server side framework. (An alternative is ASP.Net WebForms: your events are posts to the same page, abstracted to seem like desktop application events.) If you want, you can output data as JSON or XML and use this with a client side JavaScript framework to update your views.

What do controllers do JavaScript?

A controller is a function you write to control your data. With a self-written controller, you can modify data anyway you want: Convert to upper case.


1 Answers

Client side MVC means that a MVC framework is built entirely on the client side. So the server only delivers data to the application. The binding of the data to the models happens client side.

An example of a framework that implements this principle is AngularJs Another one is Ember.

Node on the server side has nothing to do with client side MVC. The data delivered to the webapp could be delivered by any technology capable of doing that.

Nodejs is often used to run client side development tools and run tests. For example, the development server that comes with the AngularJs tutorial is build on node.

like image 181
Tom Avatar answered Sep 22 '22 07:09

Tom