Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I am planning my first N-tier architecture and came across this question just as I was about to post a similar one. All the sample code I’ve seen so far passes the entire object graph over the wire every time, without regard for what changes have actually been made. I've been considering to instead take the approach described above. Although, it appears to be the road less traveled.</p> <p>I like the idea of passing back just the deltas for each modified property. For collection properties, this would be what’s been both added and removed. For a single-valued property, it could be just the new value. I could implement this in a general way such that the accumulation of these deltas would be transparent for all domain objects. And the deltas would be sent across the wire in a general form, without using DTO classes specific to my domain model.</p> <p>This made me wonder if I couldn't take the idea further by also using the same general-purpose delta data structure for communication in the direction of server to client. After all, you could have a delta that basically populates an empty object. Then I could altogether eliminate the hard-coded DTO classes. I Googled "generic DTOs" (without quotes) and found <a href="http://www.adam-bien.com/roller/abien/entry/no_duplication_no_decoupling_the" rel="nofollow">this</a> and <a href="http://en.wikipedia.org/wiki/Service_Data_Objects" rel="nofollow">this</a>. Looks like others have already applied the idea in practice.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload