Databases and Deep Copy

后端 未结 4 498
花落未央
花落未央 2021-01-19 19:32

If I find myself wanting to do a deep copy of an object stored in my relational database, have I necessarily done something fundamentally wrong architecturally? This is a di

4条回答
  •  佛祖请我去吃肉
    2021-01-19 20:08

    My take on this is that if you need a resilient clone of a database object then your best bet is to perform a deep copy - at least copying all those items that may change at some point in the future. I don't see that there's much alternative other than implementing some copy-on-write style of 'clone' which whilst it might be right in some circumstances would introduce a whole plethora of additional logic & complexity.

提交回复
热议问题