Perform model mutations server side


#1

We currently have an Ember application that is becoming a bit hard to manage. The main problem I see with how we have built it now, is that there is all too much logic on the client side. We are using Ember data, but I feel that it hasn’t been a good fit for us.

I want to change this a simpler model, where the client gets a JSON object from the server, and displays this. If there is to be any changes to the underlying model, the client sends a command to the server, and gets a response back with the updated JSON model (or vaildation errors or other errors).

The upside of this is that the client becomes simpler. It just has to deal with displaying data. It will still have to manage view state (what is select, new values for fields, new objects not yet persisted), but I believe the client will become simpler.

Rendering should be simpler as well, because instead of returning model objects from the server, I would return view models, tailored to the actual view that is going to be displayed. Values are calculated server side before sent to the client.

The downside is that changes are not necessarily immediately visible, and that the server will probably have to store the state of an object more often. If we have a wizard, then the server needs to update the data on each step, rather than just persisting the final result.

My question is, are there problems with this? Will there be performance and UI issues? Or is this a better option than complex client logic? Since the main strength of most of my developers is in Java, not in JavaScript, I think this will make their day easier.