This I think would be solved with a copy method rather than a clone
method. I expect the clone method to give me a carbon copy of my
object and I expect the copy method to update the entities state as if
creating new entities.

Sébastien

On 11/1/07, 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(R)  http://www.develop.com
>
> View archives and manage your subscription(s) at http://discuss.develop.com
>


-- 
Sébastien
www.sebastienlorion.com

===================================
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