I am coming from a non-MVC environment so this all is quite new to me, so any help is greatly appreciated.
I am trying to structure new application in Ember and in the proper way. I have something similar to this model:
User
- First Name
- Last Name
- User code
- Contact Addresses (list)
The User can be viewed on multiple screens/views - list view and then User detail view. I would like to be able to directly edit the User code and First + Last name from the list view and then all additional details from the User Edit view.
The way I had this structured before Ember (in jQuery) was that I had web services for different actions, some of which did partial updates:
- UpdateFirstName
- Partial update, fired when customer changes user’s first name from the list view
- UpdateLastName
- Partial update, fired when customer changes user’s first name from the list view
- UpdatedUserCode
- Partial update, fired when customer changes user’s user code from the list view
- UpdateUser
- Full update, fired when user is saved/updated from the edit user view
The nice thing about this structure was that it kept the web services simple and short. The negative was that UpdateUser had to replicate some of the functionality in the other web services.
It is a little strange to me to always send the whole model back to the server to update a small simple thing (from example just the user code) when I call .save() on a model. Is this the desired way, or would you recommend structuring things differently?
I am sorry if this has a super straightforward answer, I am still trying to learn to think in the MVC and Ember way.
Thanks!