Glossary

Terms used throughout the developer documentation.

DDD (Domain-Driven Design)

Term Definition
Aggregate Root An entity that serves as the entry point to a cluster of related objects. It has a repository interface and enforces invariants across its children. Example: Album is an aggregate root — it manages its own fields and rules.
Anti-Corruption Layer A set of adapters that isolate domain code from external libraries. Baander uses this for League OAuth2 Server — the domain only knows internal interfaces, not League's.
Bounded Context A distinct area of the codebase that models a specific business capability with its own domain language, rules, and data. Example: the Playlist context knows nothing about Transcoding.
Command A CQRS write operation — a DTO that carries input data to a handler. Commands are immutable (final readonly class). Example: CreatePlaylistCommand.
Domain Event A signal that something happened in the domain. Events are dispatched by handlers and listened to by other contexts. Example: TranscodeJobCompleted.
Domain Model A PHP class in Domain/Model/ that encapsulates business rules. Aggregate roots use a state object pattern; value objects are immutable with a public constructor.
Four-Layer Architecture Domain, Application, Infrastructure, Interface. Dependencies flow inward: Interface depends on Application, Application depends on Domain. Domain has no framework dependencies.
Port An interface in the Application layer that defines a capability (e.g., PlaylistPortInterface). Controllers inject ports; infrastructure implements them. This decouples the API layer from domain logic.
Repository Interface A contract in Domain/Repository/ for persisting and retrieving aggregates. The implementation lives in Infrastructure/Doctrine/Repository/.
State Object A mutable class ({Entity}State) that holds all fields of an aggregate root. It keeps the create() and reconstitute() constructors in sync and is used by the repository for persistence.
Value Object An immutable object identified by its value rather than an identity. Defined as final readonly class with a public constructor. Example: Uuid, PublicId, Email.

Infrastructure

Term Definition
CQRS Command Query Responsibility Segregation. Write operations (commands) are handled separately from read operations (queries) via Symfony Messenger.
Doctrine Entity An ORM mapping class in Infrastructure/Doctrine/Entity/ that represents a database row. Separate from the domain model — repositories convert between the two.
Messenger Symfony's message bus system. Routes commands to handlers, supports async processing via Redis transport.
PGroonga A PostgreSQL extension for fast full-text search, used by the PgroongaSearchTrait in repositories.
Port Pattern The canonical dependency inversion pattern in Baander. Application ports define interfaces; infrastructure implements them; controllers depend on ports.
Process Pool A Swoole-managed pool of worker processes used for CPU-bound tasks like FFmpeg transcoding.
SSE (Server-Sent Events) One-way real-time communication from server to client, implemented via Redis Pub/Sub.
WebSocket Bidirectional real-time communication, used for watch-party playback sync.

Data Types

Term Definition
PublicId A short, opaque identifier exposed in URLs and API responses (e.g., p_abc123). Separate from the internal UUID v7 primary key to prevent information leakage.
UUID v7 A time-sortable universally unique identifier used as the primary key for all database tables. Generated by the Uuid domain model.