Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 1
    I did this before, but stumbled on entity continuity issue. Say we created a Customer object with Id = 1. When we wanted to upgrade the that customer to a member, the code says we needed to create a new object of type Member even though it derived from Customer. Creating a member with Id = 1 would be wrong, because a Customer with that Id is already existed. Deleting the previous Customer object before seems kind of risky.. Commented Nov 11, 2013 at 6:29
  • @SamuelAdam: This sounds like a problem with your data store. If SQL use a transaction to safely delete and reinsert the object. Or depending on how it works force it to load ID 1 into a Member object instead of the default Customer. And your in memory objects should allow making a copy. So copy construct a Member from a Customer then write that back to the data store. Commented Nov 11, 2013 at 14:43