08-10-2009, 06:14 PM
|
#1 (permalink)
|
|
The Wanderer
Join Date: Jul 2009
Posts: 5
Thanks: 0
|
Destroying related objects doubt
::Destroying related objects doubt
One thing that is confusing me is regarding the lifecycle of the associated objects and the related data in the database. Suppose we have an example of object composition and in this case if I destroy de parent object then the children objects will be destroyed too.
Well, the confusion I'm doing is related to the semantics of the word 'destroy'. In my understanding when I say 'destroy' an object, it means I will unset it, but I will not 'delete' the related data in the database.
ex.: let's say we have objects House and Rooms, the relationship between them is composition, so House is responsible for creating new Rooms. If I destroy the instance of House, all instances of Rooms will be destroyed as well, but it doesn't mean I have to 'delete' them from the database, right? ... sounds like a silly question, but ...
thanks in advance, sohdubom
|
|
|
|