Skip to Content
Domain-Driven Transformation
book

Domain-Driven Transformation

by Carola Lilienthal, Henning Schwentner
November 2025
Intermediate to advanced
464 pages
11h 25m
English
O'Reilly Media, Inc.
Book available
Content preview from Domain-Driven Transformation

Appendix C. Tactical Refactorings That Support Strategic Refactorings

Strategic refactorings are still big and have to be divided into smaller steps. In this appendix we present these smaller steps—tactical refactorings that support the strategic ones. A supporting tactical refactoring is always carried out as part of a strategic refactoring.

When extracting a bounded context, you can encounter different situations:

Extract Specialized Service

Also known as: Carve Specialized Anemic Service Out of Monolithic Service

A special case of Extract Class [Fowler 2019, p. 182]

Diagram illustrating the "Extract Class" refactoring pattern by splitting the "Monolease" class's "ContractService" functions into two separate classes, retaining "vote()" in "Monolease" and moving "calculateInstallment()" and "sign()" to "offering".

Motivation

As one step of Extract Bounded Context, you’ve found a domain service that has become too big. Its functionality belongs partly in the bounded context that is extracted. The decision has been made to split it.

Mechanics

  • Create an empty new class in the carved-out context.

  • Add an instance field of type new class to the old class.

  • Copy the first to-be-moved method to the new class with Move Method [Fowler 2019, p. 198].

  • Replace the method body in the old class with a forward to the method in ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

LLMOps

LLMOps

Abi Aryan
Domain-Driven Refactoring

Domain-Driven Refactoring

Alessandro Colla, Alberto Acerbis

Publisher Resources

ISBN: 9798341640108Errata Page