Blog Logo
TAGS

Domain-Driven Refactoring: Procedural Beginnings

In this post, the author talks about their approach to writing dumb, procedural code during the red-green-refactor TDD process, and how it helps them let code smells guide them into where the code should belong. They also share a sample application with associations between Member, Offer, and OfferType classes, and a MediatR handler to assign an offer to a member with the logic for calculating offer value and expiration date. This post is part of a series covering domain-driven refactoring techniques, including long methods, extracting domain services, defactoring and pushing behavior down, encapsulating data, and encapsulating collections.