implementing-ddd-architecture

Design rich domain models with DDD, hexagonal architecture, and CQRS across bounded contexts.

5|Updated May 30, 2023
One-click install
npx skills add https://github.com/VilnaCRM-Org/core-service --skill implementing-ddd-architecture
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: implementing-ddd-architecture
Source: https://github.com/VilnaCRM-Org/core-service/tree/main/.claude/skills/implementing-ddd-architecture
Command: npx skills add https://github.com/VilnaCRM-Org/core-service --skill implementing-ddd-architecture

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Design and implement rich Domain-Driven Design architectures across bounded contexts, enabling clear separation of concerns and scalable maintenance.

Core Features & Use Cases

  • Design rich Domain models (Entities, Value Objects, Aggregates) with domain-centric behavior.
  • Implement CQRS patterns (Commands, Command Handlers, Domain Events) and proper orchestration.
  • Define Domain repository interfaces and implement them in the Infrastructure layer using XML mappings and adapters.
  • Use YAML-based validation and API platform/processor integration patterns to keep Application layer responsibilities clear.
  • Employ factories for production object creation to decouple construction from usage and improve testability.

Quick Start

Design a bounded context, implement Domain entities and value objects, define a Domain repository interface with an Infrastructure implementation, and wire up CQRS commands, handlers, and domain events via a Factory.

Frequently Asked Questions about implementing-ddd-architecture

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement a hexagonal architecture with proper domain layer separation?

Hexagonal architecture is implemented by placing business logic in the Domain layer and defining repository interfaces, using ports, adapters, and factories to decouple infrastructure from the application core.

What is the best way to structure CQRS commands and domain events across bounded contexts?

CQRS is structured by implementing dedicated command handlers and domain events within bounded contexts, keeping application layer responsibilities clear through proper orchestration and factory-based wiring.

How do I design rich domain models with pure entities and value objects?

Rich domain models are designed by creating entities, value objects, and aggregates with domain-centric behavior, enforcing domain purity by decoupling object construction from usage via production-ready factories.

How do I define repository interfaces in the domain layer and implement them in infrastructure?

Repository interfaces are defined in the Domain layer and implemented in the Infrastructure layer using XML mappings and adapters, ensuring proper separation between domain purity and data persistence.

When should I use domain events and factories in a DDD bounded context?

Domain events and factories are used when creating new domain objects across bounded contexts, decoupling construction from usage to improve testability and wiring commands via factory orchestration.

Can I use YAML-based validation and API platform processors in a DDD application layer?

YAML-based validation and API platform processors integrate with the application layer to keep responsibilities clear, ensuring domain purity while handling external request orchestration.