DTOs Collections mapping Problem

Posted by the_knight5000 on Stack Overflow See other posts from Stack Overflow or by the_knight5000
Published on 2011-01-09T13:43:36Z Indexed on 2011/01/09 13:53 UTC
Read the original article Hit count: 149

Filed under:
|
|

I'm working now on a multi-tier project which has layers as following :

  • DAL
  • BLL
  • GUI Layer

and Shared DTOs between BLL and GUI layers.

I'm facing a problem in mapping the Objects from DAO To DTO, No problem in the simple objects.

The problem is in the Objects who have child collections of another objects. ex:

Author                      Category
--Categories      --Authors 

the execution goes in an infinite loop of mapping

and it get more complex when I want model Self-join tables ex:

Safe     Safe
--TransferSafe(Collection<Safe>)        --TransferSafe(Collection<Safe>)

the execution goes in an infinite loop of mapping

any suggestions about a good solution or a practical mapping pattern?

© Stack Overflow or respective owner

Related posts about orm

Related posts about architecture