bounded library

A minimal, framework-agnostic common kernel for Domain-Driven Design (DDD).

This library provides fundamental building blocks for modeling domains:

  • Identity: Strongly-typed identifiers for entities and aggregates
  • Value Objects: Immutable objects with structural equality
  • Entities: Objects with distinct identity
  • Aggregate Roots: Consistency boundaries that enforce invariants
  • Domain Events: Records of significant domain occurrences

These primitives are infrastructure-free and can be unit tested without external dependencies.

Classes

AggregateRoot<ID extends Identity>
Base class for aggregate roots in a domain model.
BoundedDomainEvent<TId>
A convenience domain event contract.
DomainEvent
Represents something that happened in the domain.
Guard
Guard helpers for enforcing domain invariants.
IdentifiedDomainEvent<TId>
A domain event that can be uniquely identified.
Identity<T>
Base interface for domain identities.
MetadataDomainEvent
A domain event that includes arbitrary metadata.
TimestampedDomainEvent
A domain event that carries a timestamp describing when it occurred.
TypedIdentity<T>
A strongly-typed identity implementation.

Mixins

Entity<ID extends Identity>
Mixin for entities in a domain model.
ValueObject
Mixin that provides structural equality for value objects.