Domain-Driven Design (DDD) strategic and tactical design tools for domain modeling and bounded context management.
npm install @swoft/dddDomain-Driven Design (DDD) strategic and tactical design tools for domain modeling and bounded context management.
This package provides comprehensive DDD tools including strategic design for domain modeling, bounded context definition, and tactical design for aggregate implementation.
- 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
``bash`
pnpm add @swoft/ddd
`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'
});
``
- 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
- ddd, domain-driven-design, strategic-design, tactical-design, bounded-context, aggregate
- DDD & Clean Architecture Guide
- Strategic Design Patterns
---
Status: Production Ready
Maintained by: Swoft Development Team