Pjax or client side MVC?

I need to start a new project, a webapp with lots of shapes and screens, and I really don't know which technology is best. An application is an application similar to ERP, with very few animations and many forms. The goal is to reduce minimal reboots and latency, it should be as close as possible to regular desktop applications (a lot of work should look like a great VB6 application :-)

On the one hand, we have MVC on the client side (trunk). This is great when all the code runs on the client, but, in my opinion, this means repeating a lot of code (for example, all model definitions) from the server (PHP + Fuel). Of course, I once downloaded all the information, such as pagination or grid operation, without any delays, but it also presents some synchronization problems (other users can change the data, and I have to manually invalidate the data on the client).

On the other hand, we have pjax. The idea is to make all the templates, etc. On the server, it’s easy to implement logic to return a page without a frame for a pjax request or a full page for new requests. No code duplication, very simple client side.

I read a story from basecamp and twitter , and both points make sense to me. You cannot relay on a visitor computer (features, performance ...)

The more I think about it, the more I like pjax on top of MVC, but maybe I'm missing something. What are the advantages of MVC over pjax or pjax disadvantages over client side MVC?

Thank you so much

+7
source share
1 answer

Backbone.js is good for heavy single-page web applications that never go back but have a lot of ayaxian stuff, interdependent cascading dropdowns, etc. It has a very nice API for events and collections. If you have numerous client-side javascript, this can be a useful way to organize it. He is diligent in the sense that he expects your server architecture to be RESTful by default, and you should make some effort to use it for an API without RESTful.

The project I'm working on is also an ERP web application, with ASP.NET MVC on the server side. I found out that Backbone (with rudders as a template system) and .net mvc do not really play together so well. If you go Backbone, you really need to go all out (controller methods serve json, this is it). On the pages of this application, which are more or less "normal" web pages with some forms, Backbone is the wrong choice.

I first started pjax in googled, so basically I just read the short description at the top of the page, but I suspect that this may be the way to go according to your scenario, in accordance with Keep It Simple Silly principles.

+3
source

All Articles