Issues such as these are why many people prefer to avoid sending their
domain objects directly across a service boundary, and instead using
some form of DTOs, that contain the specific data needed for that view
or command.

/Oskar

2011/2/9 MARTIN Pierre <[email protected]>:
> Hello Asierrra01 and thank you for your concern about this issue.
>
> i'm not sure i'm clear about what the problem is. The limit is not an issue 
> (We already have this limit feature coded), the depth however, is.
> Let me illustrate with a piece of code:
>
> Let's say i have three tables mapped to three Castle.ActiveRecord classes:
>
> class A, having many B, belonging to C.
> class B, belonging to A, having many C
> class C, having many A.
>
>
>
> - if i query for just one object of type A, and never call the accessors 
> performing the loading of B / C on the returned instance of A, everything is 
> fine (One instance of A sits in memory after the query, not much depth is 
> walked thru).
> - Now, after the instance of A has been retrieved, the WCF method is 
> returning this instance for serialization (Because the method has the 
> [DataContract] flag the [ServiceContract] to be able to return it), then the 
> serializer tries to access all 'DataMembers' of the instance of A, and this 
> results in a serialization of a very large tree (A -> B -> C -> A -> B -> C 
> and so on).
>
> i would like to be able to say that after reaching let's say level 1 of depth 
> (A -> B) then the serializer has to stop here and not follow anymore the 
> accessors from the linked objects... This has to be a variable or a 
> parameter, because when i decide to query B with a depth level of 3, it has 
> to return all B -> C -> A -> B and populate the members as usual.
>
> Thank you very much for your time!
> Pierre.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "nhusers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/nhusers?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to