I am looking for a book or blog entry on the following DDD concepts, something specific to MVC and C# code. Quick summary: partially populated domain models from special repository methods and sending only changed domain model properties as JSON back from the client.
More details:
If you have a Customer object but need a drop down list having only customer number and customer name, you would create a special Repository method to return a full IList of Customer but only populate the customer ID and the Customer name, leaving other properties null or empty. This saves creating tons of special classes for a view model.
If you are editing a Customer, you would cache the Customer object in a session variable at the server then JSON serialize the View Model containing the Customer DDL and the first customer object for the client, possibly embedding the JSON in the first Html coming from the server. It would be really nice to have the JSON resolve to the MVC controller method "object parameters" (reassembly of the post data to an object parameter from JSON).
The client (JavaScript) instantiates the customer object and binds the object properties to the corresponding HTML input statements of the same name. When one changes, the other changes. Also throw in a template concept for IList objects. It also flags the customer object property as dirty when the input value changes (event).
Upon submit, only the changed (dirty) object properties are serialized to JSON and sent back to the server. Unchanged properties are simply left out. The server will combine the cached customer object with the partial JSON customer object (changes only), submitting the resulting Customer object to the repository to persist.
It's a really great concept. I would like to read about the theory and get a to-do list.