Domain-Driven Refactoring
summary
Refactors a legacy loyalty system into a real domain model by extracting a web-backed OfferValueCalculator domain service, converting a long handler into focused methods with ReSharper in Visual Studio 2022, and pushing expiration logic into the offer type while moving assignment behavior into the member aggregate. Uses Entity Framework and IHttpClient, introduces an interface for DI and test seams, tightens constructors and removes public setters; result is encapsulated domain objects and safer, testable behavior.
AI-written summary · about
chapters (13)
- 0:00Introduction and setup
- 1:27What is domain-driven design
- 3:54Refactoring literature and techniques
- 6:02Current loyalty system model
- 10:19Starting the refactoring process
- 15:15Extracting methods for clarity
- 19:09Moving behavior to domain objects
- 27:19Encapsulating expiration logic
- 31:30Assigning offers to members
- 37:02Protecting domain object integrity
- 43:06Finalizing domain object constructors
- 45:35Benefits of domain-driven refactoring
- 46:39Q&A and closing remarks
related talks
01h 01mDomain-Driven Refactoring
01h 02mDomain-Driven Refactoring
46mDomain-Driven Refactoring
01h 12mLegacy Refactoring
58mImplementing Domain Driven Design as a Pragmatic .NET Developer
51mDomain - Driven Transformation
59mDomain-Driven Design - Where Rubber Meets the Road
48mDomain-Driven Design tactically and practically
