stories icon indicating copy to clipboard operation
stories copied to clipboard

Entities should not know their primary key.

Open proofit404 opened this issue 5 years ago • 0 comments

  • If we read a record from the database we already know primary key of the entity.
  • If we create a record in the database, the primary key will be returned by the repository.
  • If we delete a record, we do not need entity at all.
  • If we update an entity, new fields are known outside of the entity together with the primary key. The new entity will be produced by an old entity using its method and evolve call.

The main purpose of entities is not to store the data, but expose behavior related to it.

proofit404 avatar Jul 31 '20 23:07 proofit404