Search the web
Sign In
New User? Sign Up
altdotnet · Alt Dot.Net Discussions
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
DTO - entity mapping strategies   Message List  
Reply | Forward Message #14263 of 23235 |
RE: [altdotnet] DTO - entity mapping strategies

>> in most cases I use NH mappings

I do the same. 

I work with ASP.NET MVC so I use this to serialise the objects into JSON:

http://james.newtonking.com/pages/json-net.aspx

Of course NH objects will not always serialise so I generally manually transfrom them into DTOs in that case.  I'll definitely have a look at your library to try and get some automation.

I use a JQuery plugin to serialise my javascript objects into JSON and send them to the server via an AJAX call.

That way I can do all my validation on the server.

dagda1@...


To: altdotnet@yahoogroups.com
From: zdeslav.vojkovic@...
Date: Mon, 1 Sep 2008 11:38:38 +0200
Subject: Re: [altdotnet] DTO - entity mapping strategies

I believe that this really depends on context.

Sometimes I prefer to send domain objects across the wire, in most cases I use NH mappings to map directly from DB to DTOs, and sometimes I use (a shameless plug!) this (but I find it more useful inside the presentation layer, to do mappings for presentation model, than domain->DTO)


On Mon, Sep 1, 2008 at 6:47 AM, Miika Makinen <mmiika@gmail.com> wrote:
Hi all,
How do you typically manage DTOs in your apps? Reflection? Code Gen? Manual coding? Do you have separate classes responsible for mapping or is it responsibility of the DTO itself (or entity?)? Is NH mapping to entities or DTOs?

Cheers,
Miika




Get Hotmail on your mobile from Vodafone Try it Now


Mon Sep 1, 2008 9:44 am

dagda1970
Offline Offline
Send Email Send Email

Forward
Message #14263 of 23235 |
Expand Messages Author Sort by Date

Hi all, How do you typically manage DTOs in your apps? Reflection? Code Gen? Manual coding? Do you have separate classes responsible for mapping or is it ...
Miika Makinen
khmerang
Offline Send Email
Sep 1, 2008
4:47 am

I've been down the road of reflection in the past, and I came to the conclusion that you normally end up writing as much plumbing code as you would just...
James Gregory
hypnodyno
Offline Send Email
Sep 1, 2008
8:17 am

Yep, just after posting this I also found some good discussion on the topic: http://ayende.com/Blog/archive/2007/12/05/Object--Object-mapping.aspx ...
Miika Makinen
khmerang
Offline Send Email
Sep 1, 2008
8:42 am

We're currently generating NHibernate objects (with mappings via ActiveRecord), DTOs and client-side proxies from simple C# 'interfaces' (it seems slightly...
Alun Harford
alunharford
Offline Send Email
Sep 1, 2008
9:00 am

I believe that this really depends on context. Sometimes I prefer to send domain objects across the wire, in most cases I use NH mappings to map directly from...
Zdeslav Vojkovic
zdeslav_v
Offline Send Email
Sep 1, 2008
9:38 am

... To: altdotnet@...: zdeslav.vojkovic@...: Mon, 1 Sep 2008 11:38:38 +0200Subject: Re: [altdotnet] DTO - entity mapping strategies I...
Paul Cowan
dagda1970
Offline Send Email
Sep 1, 2008
9:45 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help