Mapping a domain modeled as object in a relational database is a hard question, so may be there is not abest way to do this.
you have an object, thread, with is composed of an array of message: i think you have to introduce another layer, a message manager that receive the thread object with its own massages, and persists these.
but..
i see oop in the sense of Plato's onthology: il look at object as in real life, from its own point of view:i think that in real life a message thread has sense in its own, but a message not as it has not sense without a thread to refer to.
this leads me to think to message objects having a thread property, with a grouping layer.
hal helms wrote a good article on this argument: look at his site
hope to be usefull
regards
salvatore
----- Original Message -----
Sent: Tuesday, June 21, 2005 11:08 PM
Subject: [CFCDev] persistence of a complex object in the database

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



__________ Informazione NOD32 1.1147 (20050621) __________

Questo messaggio รจ stato controllato dal Sistema Antivirus NOD32
http://www.nod32.it
----------------------------------------------------------
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]
----------------------------------------------------------
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