I was curious on what is the best way to handle persistence of a complex object in a database including creating, updating, etc.

 

For this example I have a thread object which is in a message system. The thread contains a subject, status, created date and an array of message objects which contain data such as date created, message, user who sent the message.

 

What is the best way to persist these objects in the database? Should I be passing a completed thread object to an object which can take the whole thing and update the necessary fields in the database? Should I insert the threads and messages separately? On updating of the thread should I only the thread be updated or should the update cascade to the messages?

 

Any suggestions here?

 

Thanks a lot!

 

Joe Ferraro

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm

An archive of the CFCDev list is available at www.mail-archive.com/[email protected]

Reply via email to