Child object save/retrieve

Child object save/retrieve

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


cinnzeo posted on Monday, August 27, 2007

Hi,

I am required to design an 'Account' object which should hold several child collection objects as per the following tree:

Account
   PhoneNumbers
      PhoneNumber
   Addresses
      Address
   Invoices
      Invoice
   Orders
      Orders

Please advise on where should db setting and retrieving methods can be implement; is it suitable to implement those methods in collection objects (Collection saves/retrieves child objects) or in child objects (You have to invoke the save/retrieve method on each object)?

Provide with samples if available.

Thanks in advance.

Marjon1 replied on Monday, August 27, 2007

Cinnezo,

I'd take a look at the ProjectTracker sample project, provide with CSLA as this is a good example of where the CRUD methods are called for both root and children objects.

I also suggest doing some more research on the forums, as there are several examples of similar patterns.

http://forums.lhotka.net/forums/thread/13379.aspx

http://forums.lhotka.net/forums/thread/1612.aspx

If you are planning to work with CSLA on a regular basis, I can't recommend any better resource than the BusinessObjects book

Copyright (c) Marimer LLC