UNPKG

@swoft/ddd

Version:

Domain-Driven Design (DDD) strategic and tactical design tools for domain modeling and bounded context management.

72 lines (52 loc) 2.16 kB
# @swoft/ddd Domain-Driven Design (DDD) strategic and tactical design tools for domain modeling and bounded context management. ## 📋 Overview This package provides comprehensive DDD tools including strategic design for domain modeling, bounded context definition, and tactical design for aggregate implementation. ## 🏗️ Architecture - **Strategic Design**: Domains, Bounded Contexts, Context Mapping - **Tactical Design**: Aggregates, Entities, Value Objects, Domain Events - **Analysis Tools**: Package alignment, domain health checks - **Repositories**: DomainRepository, BoundedContextRepository, AggregateRepository ## 🚀 Installation ```bash pnpm add @swoft/ddd ``` ## 📖 Usage ```typescript import { Domain, BoundedContext, Aggregate } from '@swoft/ddd'; // Create a domain const domain = Domain.create({ name: 'Customer Management', description: 'Core customer relationship management', domainType: 'core', projectId: 'project-123' }); // Define bounded context const context = BoundedContext.create({ name: 'Customer Identity', domainId: domain.id, description: 'Customer identity and authentication', ubiquitousLanguage: ['Customer', 'Identity', 'Authentication'] }); // Create aggregate const aggregate = Aggregate.create({ name: 'Customer', boundedContextId: context.id, description: 'Customer aggregate root', purpose: 'Manage customer identity and profile' }); ``` ## 🎯 DDD Capabilities - **Strategic Design**: Domain identification and context boundaries - **Tactical Design**: Aggregate and entity modeling - **Context Mapping**: Relationship patterns between contexts - **Package Analysis**: Technical-to-domain alignment - **Health Monitoring**: DDD compliance and architecture validation ## 🏷️ Keywords - ddd, domain-driven-design, strategic-design, tactical-design, bounded-context, aggregate ## 📚 Documentation - [DDD & Clean Architecture Guide](../../docs/01-current/architecture/DDD-CLEAN-ARCHITECTURE.md) - [Strategic Design Patterns](../../docs/01-current/reference/strategic-design-patterns.md) --- **Status**: Production Ready **Maintained by**: Swoft Development Team