

Prefer to put the behavior on value objects rather than on entities because value objects are immutable and do not have side effects (like changing their state or changing the state of any entity).You can combine other value types that usually go together into a new value object type, like address (city, street, country, postal code) or.Can be used to measure or describe things (name, description, amount, height, date, time, range, address, etc.).Are only identified by their values, not by their ids (for example money is a value object as long as we are not tracking individual banknotes, if we need to track individual banknotes then it should be a banknote entity).If a business transaction needs a reference to other entities in relation, aggregates should be used instead (aggregates can hold a reference to other aggregate roots, which are entity classes by definition).Entity relations should not hold a reference to another entity class, it can only keep the id of another entity.Entity relations should not reflect the complete set of DB foreign key relationships, should be bare down to the minimum for performing the behavior inside the bounded context.Entities should not have bidirectional relations (depending on the bounded context, either an egg can have a chicken or a chicken can have eggs, but not both).


Models (entities, value objects, aggregates) with rich behavior are preferred over anemic domain models (entities without behavior, which only keep data and represent the DB tables).Bounded context helps in single responsibility for domain models.Entities with the same name in a different context can have different behavior and data.Language and terms agreed upon by both business users and developers, within a bounded context.Thin domain service working on rich domain models
