📄️ Entities & Aggregate Roots
In Domain-Driven Design, entities are objects with a distinct identity that persists over time. Aggregate roots are the primary entities that serve as the entry point for a cluster of related objects, enforcing consistency boundaries. RCommon provides a hierarchy of base classes that give you identity, equality, domain event tracking, and optimistic concurrency out of the box.
📄️ Domain Events
Domain events represent something meaningful that happened within your domain. They are raised by aggregate roots when state changes occur, then dispatched after the unit of work commits. This keeps side effects (sending emails, updating read models, publishing to message brokers) decoupled from the core business logic.
📄️ Value Objects
Value objects are a DDD building block that model concepts by their value rather than by identity. Two value objects with the same data are considered equal — there is no separate identity field. Common examples include money amounts, addresses, email addresses, date ranges, and geographic coordinates.
📄️ Auditing
Audit tracking records who created an entity, when it was created, who last modified it, and when. RCommon provides IAuditedEntity and AuditedEntity to standardize these fields across your domain model, making it straightforward to capture audit information in any persistence layer.
📄️ Soft Delete
Soft delete is the practice of marking a record as deleted rather than physically removing it from the database. The record remains in the data store with IsDeleted = true, allowing you to audit what was deleted, restore records if needed, and avoid referential integrity problems caused by physical deletes.