Alex Rivera | Logout

DDD, value objects and ORM

Asked 2009-06-04T08:45:55.310
17

Value objects do not have identity. ORM needs identity to update the database.

How to trick ORM?

(Marking Id for value object as internal won't work because ORM lives in a different assembly and moving it to the same assembly is not acceptable).

Thanks in advance.

Edit
Report

1 Answer

6

Personally I have the Id field in the value object - I treat it as another attribute of the value object (such as name, location etc).

It may not be true DDD but it works for me.

answered 2009-06-05T08:06:06.977

Your Answer