@swoft/ddd
v0.1.30
Published
Domain-Driven Design (DDD) strategic and tactical design tools for domain modeling and bounded context management.
Downloads
7
Maintainers
Readme
@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
pnpm add @swoft/ddd📖 Usage
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
Status: Production Ready
Maintained by: Swoft Development Team
