Modernize Legacy Systems and Mitigate Risk
Carola Lilienthal, Henning Schwentner

#Transformation
#DDD
#Legacy
#Team_Topologies
#Microservices
#Agile
#Refactoringهای
#MMI
📘 برای آمادهسازی نرمافزارهای قدیمی (Legacy) جهت مواجهه با آینده، مدرنسازی آنها یک امر حیاتی است. تحول دامنه-محور (Domain-Driven Transformation) رویکردی موثر برای تغییر سیستمهای بزرگ و قدیمی ارائه میدهد؛ چه از طریق شکستن آنها به Microservices و چه با تبدیل آنها به Modular Monoliths قابل نگهداری.
📖 در این راهنما، کارولا لیلینتال و هنینگ اشونتنر متد خودشان را معرفی میکنند؛ یک رویکرد جامع برای متحول کردن سیستمهای نرمافزاری که دچار فرسودگی معماری شدهاند، آن هم در سطوح استراتژیک، فنی و سازمانی. شما یاد میگیرید که چگونه فرآیندهای کسبوکار را تحلیل کنید، آنها را به Bounded Contexts تقسیم نمایید و Refactoringهای دامنه-محور را در تیمهای Agile پیادهسازی کنید. در نهایت، این کتاب راهنماییهایی برای طراحی فرآیند تحول بر اساس وضعیت فعلی معماری موجود ارائه میدهد.
🚀 این اثر که با مثالهای واقعی و بینشهای پروژه-محور پر شده است، ابزارهایی را که برای ساخت سیستمهای مقیاسپذیر، منعطف و مقاوم در برابر زمان نیاز دارید، در اختیارتان میگذارد.
✅ میزان ماژولار بودن و سلامت معماری سیستم خود را با Modularity Maturity Index (MMI) ارزیابی کنید.
✅ از Domain-Driven Design (DDD) استراتژیک و تاکتیکی برای مدیریت پیچیدگی استفاده کنید.
✅ تیمهای خود را با استفاده از Team Topologies بازسازماندهی و همسو کنید.
✅ برای شفافسازی طراحی، از متدهای EventStorming، Domain Storytelling و Scenario Casting بهره ببرید.
✅ با استفاده از الگوهایی که ریسک را کاهش داده و ارزش ایجاد میکنند، فرآیند Refactor را به صورت مرحلهای انجام دهید.
📍 فهرست مطالب
📝 از مقدمه کتاب
💬 «همه خانوادههای خوشبخت شبیه هم هستند؛ اما هر خانواده ناراضی، به روش خاص خودش بدبخت است.» این اصل آنا کارنینا نه تنها در مورد خانوادهها، بلکه در مورد تیمهای توسعه نرمافزار قدیمی نیز صدق میکند. سیستمهای نرمافزاری مختلف از «بیماریهای» متفاوتی رنج میبرند و به همین دلیل به درمانهای متنوعی برای بهبود نیاز دارند. ما در سالهای اخیر شاهد این بیماریها در ترکیبهای مختلف در سیستمهای قدیمی — چه Monolith و چه Microservices — و سازمانهای آنها بودهایم:
🏚 سیستم قدیمی به یک Big Ball of Mud تبدیل شده است، زیرا هیچکس وابستگیها را کنترل نکرده و حالا همه چیز به همه چیز متصل است (فصل ۵).
🌪 دانش دامنه در یک مدل دامنه عظیم گرفتار شده که اجزای آن فقط به صورت جزئی با هم جفت میشوند یا حتی با یکدیگر در تضاد هستند (Unbounded Models در فصل ۱۲).
🛠 کد مربوط به منطق کسبوکار و کدهای فنی با هم مخلوط شدهاند، و به همین دلیل جایگزینی تکنولوژیهای منسوخ یا توسعه دامنه به یک تسک بسیار دشوار و طاقتفرسا تبدیل شده است (فصل ۸).
👥 افراد در ساختار تیمی سازماندهی شدهاند که برای پیشرفت سریع مناسب نیست (فصل ۹).
🦋 روی جلد این کتاب تصویر یک پروانه اطلس را میبینید. درست مانند سیستمهای قدیمی این کتاب، این پروانه هم از چیزی کوچک (تخم) شروع شده، سپس به چیزی حجیم و دستوپاگیر (کرم ابریشم) و بعد به یک توپ بزرگ (پیله ابریشمی) تبدیل شده است و در نهایت به چیزی زیبا تبدیل میشود و بالهایش را باز میکند تا به سوی آیندهای روشن پرواز کند. شباهت دیگر حشره و سیستم قدیمی در اندازه آنهاست؛ پروانه اطلس یکی از بزرگترین گونههای بید در جهان با طول بال ۹ تا ۱۰ اینچ است.
👨⚕️ ما در این کتاب، درمانهایی را برای این بیماریها ارائه میدهیم که در طول ۲۰ سال کار با Domain-Driven Design (DDD) و نرمافزارهای قدیمی یاد گرفتهایم. این درمانها شامل موارد زیر میشوند: Refactorings، Domain Storytelling، EventStorming، Team Topologies و شاخص Modularity Maturity Index (MMI).
📈 وقتی ما در پروژههای خودمان و با مشتریانمان به سراغ درمان میرویم، تیم توسعه مربوطه نگاه بسیار مثبتتری به آینده پیدا میکند و انگیزه افراد افزایش مییابد. هر چه درمان بیشتر پیشرفت کند، کاربران، مدیران پروژه و ذینفعان نیز خوشحالتر میشوند، زیرا نرمافزار قدیمیِ سنگین و گرانقیمت، پایدارتر میشود، سریعتر تطبیق مییابد و در نهایت دوباره اجازه ایجاد بهبودهای نوآورانه و آیندهنگرانه را میدهد.
💻 به همین دلیل است که مثالهای متعددی از سورس کد در این کتاب پیدا میکنید. سیستمهای قدیمی که ما با آنها مواجه میشویم با زبانهای برنامهنویسی بسیار متفاوتی ساخته شدهاند: جاو، سیشارپ، پیاچپی، سیپلاسپلاس و بسیاری دیگر. ما زبانی را برای مثالها انتخاب کردیم که بیشتر با آن برخورد میکنیم: جاو. مثالها به اندازه کافی کوتاه هستند که برای برنامهنویسان زبانهای دیگر قابل درک باشند و روشی که ما شرح میدهیم مستقل از زبان برنامهنویسی است.
📚 برخی از خوانندگان ممکن است کتابهای دیگر ما یعنی Sustainable Software Architecture و Domain Storytelling را خوانده باشند. کتابی که پیش روی شماست، برای ما پیوند و نتیجه منطقی آن دو کتاب و کار روزمره ما در پروژههایمان است. خوانندگان آن دو کتاب، دامنههای مثالی مانند سینما و اجاره خودرو و دیدگاه ما در مورد معماری را تشخیص میدهند. فراتر از آن، مطالب جدید زیادی برای کشف کردن وجود دارد. صمیمانه امیدواریم از این ترکیب لذت ببرید و منتظر نظرات شما هستیم!
👤 درباره نویسندگان
👨💻 هنینگ اشونتنر عاشق برنامهنویسی با کیفیت بالاست. او این اشتیاق را به عنوان کدنویس، مربی و مشاور در شرکت WPS - Workplace Solutions دنبال میکند. او در آنجا به تیمها کمک میکند تا Monolithهای رشد یافته خود را ساختاردهی کنند یا سیستمهای جدید را از همان ابتدا با یک معماری پایدار بنا کنند. این فعالیتها اغلب به ایجاد Microservices یا سیستمهای مستقل منجر میشود. هنینگ نویسنده کتاب Domain Storytelling و وبسایت LeasingNinja.io و مترجم کتاب Domain-Driven Design kompakt است.
🎓 کارولا لیلینتال از سال ۱۹۸۸ تا ۱۹۹۵ در دانشگاه هامبورگ در رشته علوم کامپیوتر تحصیل کرد و دکترای خود را در سال ۲۰۰۸ تحت نظر کریستین فلوید و کلاوس لورنتز دریافت نمود.
دکتر کارولا لیلینتال مدیرعامل شرکت WPS - Workplace Solutions است، جایی که مسئولیت معماری نرمافزار را بر عهده دارد. از سال ۲۰۰۳، دکتر کارولا لیلینتال معماریهای مختلف در زبانهای جاو، سیشارپ، سیپلاسپلاس، ابپ (ABAP) و پیاچپی را در سراسر آلمان تحلیل کرده و به تیمهای توسعه در مورد چگونگی بهبود طول عمر سیستمهای نرمافزاریشان مشاوره میدهد. او در سال ۲۰۱۵ تجربه خود را از بیش از صد تحلیل معماری در کتاب Langlebige Softwarearchitekturen خلاصه کرد.
آموزش معماران نرمافزار برای او اهمیت ویژهای دارد، به همین دلیل عضو فعال iSAQB (انجمن بینالمللی کیفیت معماری نرمافزار) است و مرتباً دانش خود را در کنفرانسها، مقالات و دورههای آموزشی به اشتراک میگذارد.
To prepare legacy software for the future, it's essential to modernize it. Domain-Driven Transformation provides an effective approach for transforming large legacy systems—either by breaking them into microservices or by converting them into maintainable modular monoliths.
In this guide, Carola Lilienthal and Henning Schwentner present their method, a comprehensive approach for transforming architecturally eroded software systems at the strategic, technical, and team organizational levels. You'll learn how to analyze business processes, break them down into bounded contexts, and apply domain-driven refactorings within Agile teams. Finally, this book offers guidance on designing the transformation process based on the current state of the existing architecture.
Packed with real-world examples and case-driven insights, you'll uncover the tools you need to build systems that scale, support business agility, and remain resilient over time.
Table of Contents
Chapter 1. Introduction: Domain-Driven Transformation in a Nutshell
Part I. Fundamentals
Chapter 2. Mastering Complexity
Chapter 3. Domain-Driven Design
Chapter 4. Collaborative Modeling
Chapter 5. Concepts of Software Architecture
Chapter 6. How to Approach the Transformation
Part II. Technical, Tactical, and Team-Organizational Domain-Driven Transformation
Chapter 7. Technical Stabilization of Legacy Software
Chapter 8. Strengthening the Source Code with Domain Knowledge
Chapter 9. Improving Team Organization
Part III. Strategic Domain-Driven Transformation
Chapter 10. Step 1—Domain Rediscovery
Chapter 11. Step 2—Modeling the Domain-Driven Target Architecture
Chapter 12. Step 3—Alignment of Actual with Target Architecture
Chapter 13. Step 4—Prioritization and Implementation of the Transformation Measures
Part IV. Conclusion
Chapter 14. Outlook: Domain Patterns and Their Implementation in Bounded Contexts
Chapter 15. Summarizing Domain-Driven Transformation
Appendices
Appendix A. Overview of the Catalog of Domain-Driven Refactorings
Appendix B. Strategic Refactorings
Appendix C. Tactical Refactorings That Support Strategic Refactorings
Appendix D. Sociotechnical Refactorings
Appendix E. Tactical Refactorings That Strengthen Domain Knowledge
From the Preface
“All happy families are alike; each unhappy family is unhappy in its own way.” This Anna Karenina principle applies not only to families, but also to legacy software development teams. Different software systems suffer from different “diseases,” and from this comes the need for a variety of remedies to cure them all. We have observed the following diseases in various combinations in legacy systems—whether monoliths or microservices—and their organizations in recent years:
On the cover of this book you can see an Atlas moth. Just like the legacy systems in this book, it has begun as something small (an egg), then developed into something bulky and clumsy (a caterpillar) and further into a big ball (a silken cocoon), and finally transforms into something beautiful and spreads its wings to fly into a promising future. Another similarity between insect and legacy system is the size; the Atlas moth is one of the largest moth species in the world with a wingspan of 9–10 inches.
In this book, we present the treatments for these diseases that we have learned over the past 20 years working with Domain-Driven Design (DDD) and legacy software. These include: refactorings, Domain Storytelling, EventStorming, Team Topologies, and the Modularity Maturity Index (MMI).
When we approach the healing in our own projects and with our customers, the respective development team looks significantly more positively into the future and motivation increases. The further the healing progresses, the happier users, project leaders, and managers will also be because the stodgy and expensive legacy software becomes more stable, can be adapted more quickly, and ultimately even allows innovative, forward-looking enhancements (again).
That is why you will find a number of source code examples in this book. The legacy systems we encounter are built in very different programming languages: Java, C#, PHP, C++, and many others. We have chosen to write the examples in the language that we encounter most frequently: Java. The examples are short enough that they should be understandable to programmers of other languages, and the procedure we describe is independent of the programming language.
Some readers may have read our other books, Sustainable Software Architecture [Lilienthal 2019] and Domain Storytelling [Hofer and Schwentner 2022]. The book in front of you is for us the union and logical consequence of the other two books and our daily work in our projects. Readers of these two books will recognize the example domains of cinema and car leasing and our view on architecture. Beyond that, there is a lot of new stuff to discover :-) We sincerely hope you enjoy this synthesis and look forward to your feedback!
About the Author
Henning Schwentner loves high-quality programming. He lives out this passion as a coder, coach and consultant at WPS - Workplace Solutions. There he helps teams to structure their grown monoliths or to set up new systems with a sustainable architecture right from the start. This often results in microservices or self-contained systems. Henning is the author of "Domain Storytelling - A Collaborative Modelling Method" and the www.LeasingNinja.io and translator of "Domain-Driven Design kompakt".
Carola Lilienthal studied computer science at the University of Hamburg from 1988 to 1995 and obtained her doctorate in computer science under Christiane Floyd and Claus Lewerentz at the University of Hamburg in 2008.
Dr Carola Lilienthal is Managing Director of WPS - Workplace Solutions GmbH, where she is responsible for software architecture. Since 2003, Dr Carola Lilienthal has been analysing architectures in Java, C#, C++, ABAP and PHP throughout Germany and advising development teams on how they can improve the longevity of their software systems. In 2015, she summarised her experience from over a hundred analyses in the book "Langlebige Softwarearchitekturen".
The education of software architects is particularly close to her heart, which is why she is an active member of iSAQB, the International Software Architecture Quality Board e.V., and regularly shares her knowledge at conferences, in articles and at training courses.









