Skip to content

Latest commit

 

History

History
72 lines (65 loc) · 2.86 KB

entity.md

File metadata and controls

72 lines (65 loc) · 2.86 KB

Entity

An entity is a data structure that has identity.

What do we mean by that? It's all to do with how we determine if two pieces of data are the same (aka the equality operator).

  • Two values are the same if all the data in both values are identical.
  • Two entities are the same if their identities are identical.

For example, a database record that has a primary key is an entity. The primary key is its identity.

We say that two database records are the same if they have the same primary key. We don't even bother checking the other fields in the record to see if they are the same or not!

Entities are normally not immutable.