Should look up tables be modeled as Value Objects or Entities?
| Newsgroups | gmane.comp.programming.domain-driven-design |
|---|---|
| Message-ID | <[email protected]> |
I have been reading a lot of discussions here and there about modeling look up tables. Sometimes people model them as entities and sometimes as value objects. I found an example that can be used to better illustrate my idea: An Order can have a status. Allowed statuses are (placed, shipped, cancelled, refunded). ERDs taught us to create a table for the allowed statuses and link them to the Order table using a foreign key, so the relation between Order and Status is Many-to-One. For the domain model I would have two entities Order and Status mapping to the 2 tables mentioned before. How should I determine if the status look up table is better suited to be an entity or Value object?