Coffeehouse Post

Single Post Permalink

View Thread: Relational models from database > server > client AND back again
  • User profile image

    , Jim Young wrote

    The important thing in my mind is to have a distinct and isolated layer where database access occurs and marshals the data up to the POCO classes.

    I think this is where I'm leaning... something like a distinct ViewModel layer containing my "client-safe" classes (almost the same as my DAL POCOs but with actual List<ViewModelPoco>, sans id's or other private sensitive info) and manually build up the state of my complex ViewModel step-by-step in each ViewModelPoco class constructor, by selecting out the "children" FK List<ViewModelPoco>. I know there are libraries like valueinjector to assist in merging the POCO values onto the ViewModelPoco values.

    , ScanIAm wrote

    Plus, it's wasteful of bandwidth to bring along all that data if it isn't absolutely necessary for the UI.  You want to display a subset of what's in the POCO, so only transmit that.

    I've been reading up on angular.js and that framework promises 2-way databinding on complex JSON. I think the amount of data transmitted would be offset by the fact I'll be dealing with a relatively "fat" client. A lot of multi-step stuff would be happening only in the browser, then submitting everything at the end in one post. (I know this is not REST).