Relearning Java Design Patterns cover

Relearning Java Design Patterns

Rating 3.6
Word count
87K words
Chapters
192
ISBN
9787121409387

Tags

Summary

This book is a practical guide to Java design patterns built on real-world internet case studies. Organized around solutions, it draws 22 authentic scenarios from actual development work—including trading, marketing, rule engines, middleware, and framework source code—to deliver a comprehensive, in-depth analysis of design patterns. It helps readers apply patterns flexibly, handle complex and shifting business requirements with confidence, and write code structures that are easy to maintain and extend. The book combines lively animated illustrations with class structure diagrams from real development, so readers grasp not only the concepts and principles of design patterns but also how to implement them in practice. It further covers DDD four-layer architecture, RPC middleware design, distributed domain-driven design, and how design patterns integrate with these approaches. This book is suitable for developers in the computer industry and for university students majoring in computer science. Both beginners and mid- to senior-level developers will benefit from it.

Editor's review

Built around real internet business cases, this book explains Java design patterns through 22 scenarios spanning trading, marketing, rule engines, middleware, and framework source code, avoiding the common pitfall of teaching concepts without showing how to apply them. The author analyzes design patterns in the context of complex, changing business requirements and pairs animated illustrations with class structure diagrams to help readers connect pattern principles to code structure. The book also extends into DDD four-layer architecture, RPC middleware design, and the integration of distributed domain-driven design with design patterns, giving it an architectural perspective beyond a mere catalog of patterns. For Java developers seeking to improve code maintainability and extensibility, this book serves as a practical guide that moves from "knowing patterns" to "using patterns to solve business problems," and it is also suitable as advanced reading for computer science students after they have studied object-oriented design.

Who it's for

A good fit for

  • Junior to mid-level developers with some Java foundation who want to improve code maintainability and extensibility
  • Engineers working on complex business systems such as trading, marketing, or middleware
  • Computer science students who have studied object-oriented design and basic design patterns and need real-world cases

Not a good fit for

  • Absolute beginners with no Java syntax foundation
  • Developers focused only on front-end or non-Java stacks who do not work with server-side design

Reading tips

  1. Read chapters in business-scenario order; after each pattern, close the book and redraw the class structure diagram yourself
  2. Reproduce the code structures locally from the book's cases, focusing on how patterns respond to requirement changes
  3. Save the DDD and middleware design chapters for a second read, and compare them with your own project architecture

About the publisher

Publishing House of Electronics Industry China · Founded in 1982

The Publishing House of Electronics Industry is a comprehensive publisher distinguished by its focus on electronic information and related fields. Judging from the more than 3,000 titles in its catalogue, its publishing covers programming and design, artificial intelligence, computer science, finance and economics, photography, and social sciences, attending both to cutting-edge technology and to general readers. Representative titles include Factor Investing: Methods and Practice, x86 Assembly Language: From Real Mode to Protected Mode, The RISC-V Reader, Artificial Intelligence: Speech Recognition, Understanding and Practice, Phased Array Radar Technology, Radar Target Characteristics, and 100 Go Mistakes and How to Avoid Them, most of which centre on technical methods and engineering practice. Its authors include Shi Chuan, Li Zhong, Wang Xiaobo, David Patterson, Andrew Waterman, and Yu Zihao, among others from China and abroad. Owing to limited public information, no further publishing features are elaborated here.

Contents

  1. 版权信息
  2. 作者介绍
  3. 内容简介
  4. 推荐语
  5. 前言
  6. 第1章 设计模式介绍
  7. 1.1 设计模式是什么
  8. 1.2 谁发明了设计模式
  9. 1.3 设计模式有哪些种类
  10. 1.4 该如何学习设计模式
  11. 第2章 六大设计原则
  12. 2.1 单一职责原则
  13. 2.2 开闭原则
  14. 2.3 里氏替换原则
  15. 2.4 迪米特法则原则
  16. 2.5 接口隔离原则
  17. 2.6 依赖倒置原则
  18. 第3章 设计模式如何落地
  19. 3.1 设计模式该怎样学
  20. 3.2 为什么使用设计模式
  21. 3.3 设计模式的落地经验
  22. 第4章 工厂模式
  23. 4.1 码农心得
  24. 4.2 工厂模式介绍
  25. 4.3 模拟发放多种奖品
  26. 4.4 违背设计模式实现
  27. 4.5 工厂模式重构代码
  28. 4.6 本章总结
  29. 第5章 抽象工厂模式
  30. 5.1 码农心得
  31. 5.2 抽象工厂模式介绍
  32. 5.3 缓存集群升级场景
  33. 5.4 违背设计模式实现
  34. 5.5 抽象工厂模式重构代码
  35. 5.6 本章总结
  36. 第6章 建造者模式
  37. 6.1 码农心得
  38. 6.2 建造者模式介绍
  39. 6.3 装修套餐选配场景
  40. 6.4 违背设计模式实现
  41. 6.5 建造者模式重构代码
  42. 6.6 本章总结
  43. 第7章 原型模式
  44. 7.1 码农心得
  45. 7.2 原型模式介绍
  46. 7.3 试卷题目乱序场景
  47. 7.4 违背设计模式实现
  48. 7.5 原型模式重构代码
  49. 7.6 本章总结
  50. 第8章 单例模式
  51. 8.1 码农心得
  52. 8.2 单例模式介绍
  53. 8.3 案例场景介绍
  54. 8.4 七种单例模式实现方式
  55. 8.5 本章总结
  56. 第9章 适配器模式
  57. 9.1 码农心得
  58. 9.2 适配器模式介绍
  59. 9.3 MQ消息体兼容场景
  60. 9.4 违背设计模式实现
  61. 9.5 适配器模式重构代码
  62. 9.6 本章总结
  63. 第10章 桥接模式
  64. 10.1 码农心得
  65. 10.2 桥接模式介绍
  66. 10.3 多支付和多模式组合场景
  67. 10.4 违背设计模式实现
  68. 10.5 桥接模式重构代码
  69. 10.6 本章总结
  70. 第11章 组合模式
  71. 11.1 码农心得
  72. 11.2 组合模式介绍
  73. 11.3 决策树场景模拟
  74. 11.4 违背设计模式实现
  75. 11.5 组合模式重构代码
  76. 11.6 本章总结
  77. 第12章 装饰器模式
  78. 12.1 码农心得
  79. 12.2 装饰器模式介绍
  80. 12.3 单点登录场景模拟
  81. 12.4 违背设计模式实现
  82. 12.5 装饰器模式重构代码
  83. 12.6 本章总结
  84. 第13章 外观模式
  85. 13.1 码农心得
  86. 13.2 外观模式介绍
  87. 13.3 中间件场景模拟
  88. 13.4 违背设计模式实现
  89. 13.5 外观模式重构代码
  90. 13.6 重构后工程验证
  91. 13.7 本章总结
  92. 第14章 享元模式
  93. 14.1 码农心得
  94. 14.2 享元模式介绍
  95. 14.3 缓存优化查询场景
  96. 14.4 违背设计模式实现
  97. 14.5 享元模式重构代码
  98. 14.6 本章总结
  99. 第15章 代理模式
  100. 15.1 码农心得
  101. 15.2 代理模式介绍
  102. 15.3 MyBatis-Spring中代理类场景
  103. 15.4 代理类模式实现过程
  104. 15.5 本章总结
  105. 第16章 责任链模式
  106. 16.1 码农心得
  107. 16.2 责任链模式介绍
  108. 16.3 系统上线审批场景
  109. 16.4 违背设计模式实现
  110. 16.5 责任链模式重构代码
  111. 16.6 本章总结
  112. 第17章 命令模式
  113. 17.1 码农心得
  114. 17.2 命令模式介绍
  115. 17.3 餐厅点餐场景
  116. 17.4 违背设计模式实现
  117. 17.5 命令模式重构代码
  118. 17.6 本章总结
  119. 第18章 迭代器模式
  120. 18.1 码农心得
  121. 18.2 迭代器模式介绍
  122. 18.3 组织架构树形结构遍历场景
  123. 18.4 迭代器模式遍历组织结构
  124. 18.5 本章总结
  125. 第19章 中介者模式
  126. 19.1 码农心得
  127. 19.2 中介者模式介绍
  128. 19.3 手写ORM中间件场景
  129. 19.4 违背设计模式实现
  130. 19.5 中介者模式开发ORM框架
  131. 19.6 ORM框架测试
  132. 19.7 本章总结
  133. 第20章 备忘录模式
  134. 20.1 码农心得
  135. 20.2 备忘录模式介绍
  136. 20.3 系统上线配置回滚场景
  137. 20.4 备忘录模式记录系统配置
  138. 20.5 本章总结
  139. 第21章 观察者模式
  140. 21.1 码农心得
  141. 21.2 观察者模式介绍
  142. 21.3 小客车摇号通知场景
  143. 21.4 违背设计模式实现
  144. 21.5 观察者模式重构代码
  145. 21.6 本章总结
  146. 第22章 状态模式
  147. 22.1 码农心得
  148. 22.2 状态模式介绍
  149. 22.3 活动审批状态流转场景
  150. 22.4 违背设计模式实现
  151. 22.5 状态模式重构代码
  152. 22.6 本章总结
  153. 第23章 策略模式
  154. 23.1 码农心得
  155. 23.2 策略模式介绍
  156. 23.3 各类营销优惠券场景
  157. 23.4 违背设计模式实现
  158. 23.5 策略模式重构代码
  159. 23.6 本章总结
  160. 第24章 模板模式
  161. 24.1 码农心得
  162. 24.2 模板模式介绍
  163. 24.3 模拟爬虫商品生成海报信息场景
  164. 24.4 模板模式案例工程
  165. 24.5 本章总结
  166. 第25章 访问者模式
  167. 25.1 码农心得
  168. 25.2 访问者模式介绍
  169. 25.3 不同用户对学生身份访问视角场景
  170. 25.4 访问者模式案例工程
  171. 25.5 本章总结
  172. 第26章 DDD四层架构实践
  173. 26.1 领域驱动设计介绍
  174. 26.2 商品下单规则场景
  175. 26.3 规则树DDD四层架构
  176. 26.4 测试验证
  177. 26.5 本章总结
  178. 第27章 RPC中间件设计开发
  179. 27.1 RPC介绍
  180. 27.2 案例目标
  181. 27.3 Spring自定义配置文件
  182. 27.4 Netty通信组件
  183. 27.5 RPC功能逻辑实现
  184. 27.6 RPC框架验证
  185. 27.7 本章总结
  186. 第28章 分布式领域驱动架构设计
  187. 28.1 关于需求
  188. 28.2 实践场景
  189. 28.3 架构设计
  190. 28.4 父类工程
  191. 28.5 分布式框架
  192. 28.6 本章总结

FAQ

Can Java beginners read this book directly?
Not recommended for absolute beginners. The book explains pattern implementation through real internet business cases and requires readers to have Java syntax, object-oriented fundamentals, and basic development experience. Beginners will benefit more from first learning basic syntax and simple design principles before reading this book.
Can the cases in the book be used directly in real projects?
The cases come from real business scenarios such as trading, marketing, rule engines, and middleware, and their class structure diagrams and implementation approaches offer useful reference. However, specific business contexts and constraints differ, so it is better to understand the intent of each pattern and adapt it to your own project rather than copying code structures verbatim.
How much of the book is devoted to DDD?
According to the introduction, the main body of the book analyzes design patterns across 22 real scenarios, and it also covers DDD four-layer architecture, RPC middleware design, and the integration of distributed domain-driven design with design patterns. DDD is supplementary content, and it is best read after mastering the pattern fundamentals.
Do the animated illustrations help in understanding design patterns?
Yes. The difficulty of design patterns often lies in object relationships and call flows. Animated illustrations, together with class structure diagrams from real development, connect concepts and principles with implementation methods, making them useful to consult alongside the textual analysis to deepen understanding of structural changes.

Comments

Find this book

This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.

About the author

付政委 Author

Fu Zhengwei is an author whose publicly available information is limited; at present, only the representative work Relearning Java Design Patterns is known. Judging from the title, the book is aimed at Java developers and takes design patterns as its entry point, emphasizing a fresh review and mastery of classic design patterns in programming practice. Its common category is programming design, indicating that the book is technical writing oriented toward engineering practice and code design. Design patterns are a fundamental topic in object-oriented development, and books on this subject generally need to combine theoretical explanation with example demonstrations to help readers understand the applicable scenarios and trade-offs behind each pattern. Given the limited biographical information about the author, readers should focus on the work itself: it is suitable for developers who wish to consolidate their foundation in design patterns and deepen their understanding through the Java language, and it can also serve as a reference during the study of programming design.

Top rated in the same category