Business Logic
3 pages
-
Business Logic Implementation Patterns
pattern
Four-pattern spectrum: transaction script, active record, domain model, event-sourced domain model; subdomain-to-pattern mapping; transaction script failure modes; full tactical decision tree (pattern→architecture→testing strategy); migration paths between patterns
-
Domain Model Pattern
pattern
DDD tactical pattern for core subdomain business logic: value objects (immutable, identified by values), entities, aggregates (consistency boundary, one-per-transaction rule, aggregate root, OCC), domain events, domain services; Evans elaborations on associations, entity identity, context-dependent entity/VO classification, service partitioning, modules as model elements
-
Specification Pattern
pattern
predicate VALUE OBJECT for expressing domain rules: three uses (validation, selection/querying, building to order); composite Specification with AND/OR/NOT; subsumption; integrates with REPOSITORY via selectSatisfying()