Entities

As stated in the introduction section, an entity is a mutable object. It can change its attributes without changing its identity. For example, a product is an entity, which is unique and won't change its ID (distinctiveness) once it is set.

However, its price, description, and so on, can be changed as many as times it needs to.

The preceding diagram depicts an entity along with an example. An employee ID is unique and never changes. However, there is a contact detail that can be modified by accessor methods.

Entities have the following properties:

  • They are defined by their identity
  • The identity remains the same throughout its lifetime
  • They are responsible for equality checks
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset