Book suggestion on this DDD concept specific to ASP.NET MVC and JSON? [closed]


Book suggestion on this DDD concept specific to ASP.NET MVC and JSON? [closed]



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.




Is it better to return the most specific or most general type from an action method?

1:



How to make these 2 blocks of almost identical code reusable?
(I am not providing a book recommendation.


Using ASP.NET MVC 2, StructureMap, Fluent NHibernate, and PostgreSQL
I'm only posting an answer because I ran out of space in the comment box)..
ASP.NET MVC application security
I don't think this "pattern" has much to do with DDD, but it all sounds so appealing, doesn't it? .
What separates self taught from trained professional devolpers? [closed]
I have to say, though, that this screams "I'm going to work so long and hard on this awesome framework that will in the end net little to no performance benefit, but I'll wedge it into my application because I spent so long on it." Either that, or trying to implement this will prevent the application from actually being realized..
What is causing this DatabaseFileLockedException when trying to open a db4o database in an ASP.NET MVC app?
ASP.NET MVC model binding does a lot of what you're aiming for, albeit not in precisely the way you describe.


ASP.NET MVC Experiences/Success Stories [2010]
What it doesn't do is the "only send back dirty properties" bit, but to be honest any web application that is going to net a benefit from this after all the client-side logic is more than likely poorly designed on another level (data not paged; individual views too heavy)..
MVC2 Html Helpers
I don't see any benefit from caching the object in session and this is anathema to the ASP.NET MVC system anyway.. Loading only needed objects/collections from a repository is a solved problem using a first-class object-relational mapping technology, such as NHibernate.. Save the JSON for asynchronous operations.. All of this aside, what you are describing could be loosely considered as a set of optimizations that could be implemented in a piecemeal fashion, once the core of the application is working.

This ensures that you deliver some value, and only do the substantial work of implementing these optimizations (if they even prove to be such) if performance is not acceptable..


2:


Phil Haack has much of this in his blog, talking about MVC 2 Futures, JSON validators, Json2.js, and the like.

It all works very well.

This is the post..



74 out of 100 based on 59 user ratings 1084 reviews

@