UNPKG

domain-objects

Version:

A simple, convenient way to represent domain objects, leverage domain knowledge, and add runtime validation in your code base.

23 lines 1.2 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DomainEntity = void 0; const DomainObject_1 = require("./DomainObject"); /** * In Domain Driven Design, an Entity is a type of Domain Object for which: * - properties change over time * - e.g., it has a lifecycle * - identity matters * - i.e., it represents a distinct existence * - e.g., two entities could have the same properties, differing only by id, and are still considered different entities * - e.g., you can update properties on an entity and it is still considered the same entity * * The purpose of a Domain Entity is to represent objects which have distinct identities, lifecycles, and existence important in the domain. * * For example, * - A `User { uuid, name, address, profilePicture }` is an entity. Properties like `name`, `address`, and `profilePicture` can change over time. * - A `Task { uuid, requestId, status }` is an entity. We expect `status` to change over time as the task goes from, for example, `QUEUED` to `FULFILLED`. */ class DomainEntity extends DomainObject_1.DomainObject { } exports.DomainEntity = DomainEntity; //# sourceMappingURL=DomainEntity.js.map