Published: April 19, 2022
43
24
122

A surprisingly common approach I don't understand is to have two sets of entities in an app, one "DDD" entity and one "ORM" entity. I recommend using just one entity for every entity. Make the ORM entity as much as possible a DDD entity, right?

Well, it doesn't always have to be different. The examples I've seen were just copies "because we should decouple from the DB/ORM". Having separate classes has no benefit there. For the view (or "message model" I guess) I do recommend always using a dedicate DTO.

Share this thread

Read on Twitter

View original thread

Navigate thread

1/2