Help !! DeepData DTO

Help !! DeepData DTO

Old forum URL: forums.lhotka.net/forums/t/3563.aspx


sdoc posted on Tuesday, September 18, 2007

I had a question. I was going through the DNR TV show on CSLA .NET and data access and this piece of code in the DeepData example is raising tons of questions in my head regarding the usage of DTO.

In the OrderList.FetchDto...

Using dal As DeepData.DAL.OrderData = df.GetOrderDataObject
        data = CType( dal.GetOrders, DeepData.DTO.OrderDto())
      End Using
      If data IsNot Nothing Then
        For Each order As DeepData.DTO.OrderDto In data
          Add(OrderInfo.GetOrderInfo(order))
        Next
      End If


The dal.getOrders gets all the parents,the children and the grandchildren in Generic Lists. Then why do the
OrderInfo.GetOrderInfo (order) again to get all the data? Isnt that redundant? Did I miss something?

JoeFallon1 replied on Tuesday, September 18, 2007

"Then why do the OrderInfo.GetOrderInfo (order) again to get all the data?"

If you look closely it is NOT getting anything again.

It is looping over the retrieved data object and then filling a BO named OrderInfo using the order data from the DTO.

Joe

 

Copyright (c) Marimer LLC