1/9

Entities and value objects

Two kinds of thing live inside any context:

  • An entity has identity that survives change. A Stellar Account is the same account after a thousand payments — its address is its identity; its balances are just state.
  • A value object is its value. A Stellar Asset is a code plus an issuer: two USDC from the same issuer are interchangeable — indistinguishable, in fact. Change the issuer and you haven't edited the asset; you're holding a different asset.

Entities are tracked. Values are compared. Mixing the two up is how ghost bugs are born.