Martin
Martin

Reputation: 24308

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

Upvotes: 5

Views: 2314

Answers (3)

Dan Turner
Dan Turner

Reputation: 2243

Please refer to my answer to a similar question

My short answer is MVC is absolutely not wasted when using client side frameworks. MVC is about so much more than writing views in Razor. You get model-binding, validation, authentication and the ability to to control your URL structure through choice of controllers, actions and routes. 80% of the goodness is useful even without using server-side views.

Upvotes: 2

Hector Correa
Hector Correa

Reputation: 26690

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.

Upvotes: 6

Raynos
Raynos

Reputation: 169383

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

Upvotes: 9

Related Questions