Josh

I'm ok on this one. I keep a periodic archive of a record in the database,
so I already take care of changing the identities in the record and its
children after the clone.

Thanks
David.


On Wed, 31 Oct 2007 16:50:44 +0000, josh robb <[EMAIL PROTECTED]>
wrote:

>> 2- Semantics: A well-behaved implementation of Clone would be expected
>> to recursively call Clone on any ICloneable objects it contains. This
>> does not happen when you do binary serialization, which can be an
>> issue.
>
>There's also a third semantic issue which can be a problem depending
>on your particular use case. If your doing this to clone an entity
>object which is de/rehydrated from a database and contains a primary
>key value (e.g. an public int Id {get; set;} or similar) then your
>"cloned" object (and it's collections of objecs) will likely cause
>problems for whatever infrastructure you use to persist this to the
>database. (e.g. attempting to save two different objects with the same
>PK). This is solvable - but needs to be carefully considered -
>especially when child collections of entities are taken into account.
>(e.g. Order -> OrderLine -> Product ).
>
>HTH,
>
>j.

===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to