# Aggregate

Record: `arch:aggregate`
Kind: pattern
Layer: [Domain Modeling](https://banes-lab.com/records/layer/domain-modeling.md)
Severity: contextual
Scope: domain, consistency boundary, bounded context
Canonical: https://banes-lab.com/ontology#arch-aggregate

## Repair

- Refactored by: Define Aggregate Root, Enforce Invariants Within
- Detected by: cross-entity invariant checks scattered in services
- Violated by: invariants enforced by services outside the entity cluster
- Measured by: out-of-aggregate invariant enforcement count
- Enforced by: domain model review

## requires

- [Explicit Boundaries](https://banes-lab.com/records/arch/explicit-boundaries.md)

## reinforces

- [Invariants](https://banes-lab.com/records/arch/invariants.md)
- [Encapsulation](https://banes-lab.com/records/arch/encapsulation.md)

## enables

- [Transactional Consistency Boundary](https://banes-lab.com/records/lex/transactional-consistency-boundary.md)
- [Root-Guarded Invariants](https://banes-lab.com/records/lex/root-guarded-invariants.md)

## conflicts-with

- [Anemic Domain Model](https://banes-lab.com/records/arch/anemic-domain-model.md)

## tensions-with

- [Aggregate Size](https://banes-lab.com/records/lex/aggregate-size.md)

## tensions

- [Aggregate Aggregate Size](https://banes-lab.com/records/tension/aggregate-aggregate-size.md)

## referenced-by

- [Domain Service](https://banes-lab.com/records/arch/domain-service.md)
