Programming Entity Framework
Programming Entity Framework By Julia Lerman
February 2009
Pages: 828


Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
Dto Objects
hsueh010
post Oct 13 2009, 12:18 PM
Post #1


Active Member
**

Group: Members
Posts: 12
Joined: 2-September 09
Member No.: 20,011



Julie,

Why create DTO objects and not simply use Entity Objects that are detached from the context?
ie pass to the client the object that comes back from your GetDetachedFromServer methods?

Just a curosity...

--Ming
(hsueh010)
Go to the top of the page
 
+Quote Post
hsueh010
post Oct 15 2009, 12:13 PM
Post #2


Active Member
**

Group: Members
Posts: 12
Joined: 2-September 09
Member No.: 20,011



Only reason I ask is I attended a lecture on RIA Services, and RIA Services seem to be a good match with Entity Framework.

Anyone here using Entity Framework with an RIA Service? (Instead of a WCF Service)

Go to the top of the page
 
+Quote Post
JulieLerman
post Nov 1 2009, 06:27 AM
Post #3


Active Member
****

Group: O'Reilly Author
Posts: 102
Joined: 17-September 08
Member No.: 836



1) EntityObjects across the wire are *fat*. THere is so much extraneous information in there.
2) If you pass entityObjects to the client and the client creates an objectContext and then the user edits data, the changes that the ObjectContext are tracking do not get sent back to the server when you send the entities back. So I see no value in having EntityObjects ont he client site.
3) If you are writing a service that might be consumed by non-.NET clients, the DTOs are clean but with EntityOBjects, they will have to do a lot of work to extract the meaningful data.

Entities behind Astoria & RIA Services is a whole different story. You don't control what the objects going cross the wire from Astoria look like. You have to take whatever those services give you.

I have a lot of work to do with RIA before I can make recommendations along the lines of using them.

hth
Sorry for delayed reply.

Julie

Go to the top of the page
 
+Quote Post
hsueh010
post Nov 1 2009, 08:54 AM
Post #4


Active Member
**

Group: Members
Posts: 12
Joined: 2-September 09
Member No.: 20,011



Julie,

Thank you for your insight. I understand that DTO objects are "heavy" objects, which is why it is not preferred to pass Datasets over the wire either.

The only reason I was asking the question was because I had attended a lecture given by Tim McCarthy in San Diego about RIA services, and it looked like an RIA service was one of the missing pieces with working with EF and a disconnected client.

I'm still trying to get the hang of EF, but after going through your book, and resolving some of my understanding, all I could think of during Tim's presentation is that RIA service was what EF was missing.

If you do get a chance to look into an RIA service, let me know what your opinions are and how it would work with EF.

Thank you again for your time.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

RSS Lo-Fi Version Time is now: 22nd November 2009 - 05:07 AM