Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC + Backbone.js, does this have any sense? ASP.NET MVC really needed?

I have been thinking of doing some development with backbone.js javascript framework and i currently use ASP.NET MVC...

After considering this, it seems the ASP.NET MVC server side part would be redundant...

Backbone.js would contain my models which i would get by calling a REST service on my WCF machine.

My ui would be updated by Backbone / js ...

Any logic would be in backbone.js controllers that is necessary to be executed on the client side.

I would really love some input, because i seemed to have arrived at the assumption that ASP.NET MVC is wiped out by backbone.js..

Anyboyd using both, why? and how?

Thanks in advance

like image 338
Martin Avatar asked Jul 22 '11 12:07

Martin


People also ask

Is Backbone MVC?

Backbone. js is a model view controller (MVC) Web application framework that provides structure to JavaScript-heavy applications. This is done by supplying models with custom events and key-value binding, views using declarative event handling and collections with a rich application programming interface (API).

What is mvc6?

MVC 6 is a part of ASP.NET 5 that has been designed for cloud-optimized applications. The runtime automatically picks the correct version of the library when our MVC application is deployed to the cloud. The Core CLR is also supposed to be tuned with a high resource-efficient optimization.


2 Answers

I would really love some input, because i seemed to have arrived at the assumption that ASP.NET MVC is wiped out by backbone.js..

No. backbone runs on the client.

There's a difference between what can be run on the client and server.

However it is actually valid to not have your server as middleware and just expose the database over REST.

You will of course need proper login mechanisms and permissions set up on the database for security.

You need the server for closed-source code however.

If you want to use C# / .NET / Massive code-reuse. Massive pattern re-use use the server-side middleman.

The concept of large application with only client & database is un-tested and there's little knowledge about "What's good practice" because those don't exist.

Of course you could server-side javascript like node.js instead and be able to re-use all your backbone models/collections on the server & client. This might be more optimal for you

like image 72
Raynos Avatar answered Sep 27 '22 23:09

Raynos


Funny, I would have actually approached it the other way around: keep MVC instead of WCF. It does not matter if your MVC project will only server "data" rather than "views" to its clients MVC still provides a lot of the plumbing required for web applications.

like image 44
Hector Correa Avatar answered Sep 28 '22 00:09

Hector Correa