m09-domain

Installation
Summary

Domain-driven design patterns for modeling entities, value objects, and aggregates in Rust.

  • Distinguishes between Entities (unique identity required), Value Objects (interchangeable by value), and Aggregates (owned hierarchies), with clear Rust patterns for each
  • Emphasizes invariant preservation through private fields, validated constructors, and type-state patterns
  • Provides templates for common DDD structures: newtypes for value objects, structs with ID fields for entities, and module boundaries for aggregates
  • Traces design decisions upward to domain constraints and downward to ownership and type-driven implementation patterns
SKILL.md

Domain Modeling

Layer 2: Design Choices

Core Question

What is this concept's role in the domain?

Before modeling in code, understand:

  • Is it an Entity (identity matters) or Value Object (interchangeable)?
  • What invariants must be maintained?
  • Where are the aggregate boundaries?

Domain Concept → Rust Pattern

Domain Concept Rust Pattern Ownership Implication
Related skills

More from zhanghandong/rust-skills

Installs
676
GitHub Stars
1.1K
First Seen
Jan 20, 2026