Breaking Bad Code: From simple problems to complicated solutions and back
summary
Working on modularizing a huge monolith exposes concrete anti‑patterns: choosing Kafka/MongoDB before requirements, entities as dumb DTOs with generated getters/setters, business logic hidden in setters, a sprawling God entity and many Boolean flags that allow illegal states. The fix is to model an approval request aggregate with value objects, entities, aggregates, a clear application service layer, domain services and domain events (optionally event sourcing). Result: single-place business rules, fast unit tests, simpler integrations and noticeably fewer production surprises.
AI-written summary · about
chapters (28)
- 0:00Introduction and setup
- 3:01Approval request system explained
- 5:56Premature technology decisions
- 7:22Data-centric anti-patterns
- 9:09Anemic domain models
- 10:38Exposing entities in APIs
- 12:26Business logic in getters/setters
- 14:58God entities and their dangers
- 17:27Concept generalization pitfalls
- 19:18Boolean flags and state issues
- 21:36Internal state exposure risks
- 22:19OOP and behavior encapsulation
- 25:50Domain modeling fundamentals
- 27:16Domain model protection
- 29:03DDD tactical patterns
- 31:54Aggregates and consistency
- 34:47Domain events and history
- 35:51Domain services for complex logic
- 37:37Application service layer
- 39:45Integration layer design
- 41:12Published language concept
- 42:37Event sourcing benefits
- 44:01DDD toolbox and anti-patterns
- 45:27OOP principles and DDD
- 46:10Benefits of clean domain code
- 48:16Recommended DDD resources
- 50:25Architecture book recommendations
- 51:08Engineering leadership initiative
related talks
50mThe Anatomy of Business Conditions
43mArchitecture antipatterns and how to beat them 1/2
59mDecomposition Patterns
52mEvolving a Pragmatic, Clean Architecture A Craftsman's Guide
54mArchitecture antipatterns and how to beat them 2/2
01h 07mThe courage to business logic - Business Driven Architecture
02h 29mPractical advice for building glorious monoliths
48mDomain Driven Design: The Good Parts
