|
所在平台: Udemy |
课程主页: https://www.udemy.com/course/pyramid-of-refactoring-java-chain-of-poker-hands/
课程评论:没有评论
课程名称:从遗留代码重构为责任链模式 课程概述:这是一个专门针对将遗留代码转换为清晰代码的系列课程的第二个模块。尽管《重构》和《重构模式》这两本核心重构书籍中并没有提到重构为责任链模式的方法,但这些书中描述的技术为这样的重构之旅提供了计划。课程的目标是解耦代码库中深层嵌套的条件语句(if/else)。这种情况非常常见,如果长时间不处理,会导致复杂的遗留代码在随后的代码扩展中累积。 在课程中,我们将使用重构技术并实时进行所有更改。参与者下载源代码,并与讲师一起一步步进行所有更改。在这个示例中,我们将责任链设计模式作为重构旅程的目标。通过责任链模式的实践,参与者将体验到多种代码转换,如: - 合并 if 语句 - 合并嵌套 if 语句 - 提取方法 - 用查询替代临时变量 - 移动方法 - 内联方法 - 提取类 / 提取委托 - 提取接口 - 重命名方法和变量 课程以作业结束,参与者可以体验在清晰代码和遗留代码中实现附加需求的差异,这是跳过和应用准备性重构之间的区别。
This is the second module of series dedicated to turning Legacy Code into Clean CodeAlthough Refactoring to Chain of Responsibility is not mentioned in the core refactoring books ("Refactoring" & "Refactoring to Patterns") the techniques described in these books allow to create a plan for such a refactoring journey.The goal of the course is to disentangle the codebase from a set of deeply nested conditional if/else statements. It is a very common case - and if it is left for a long time - then it leads to a very complex legacy code after subsequent code extensions.We use refactoring techniques and perform all the changes live. The particitants download the source code and performs all the changes together with the trainer - step by step. In this sample we make use of Chain of Responsibility Design Pattern as goal of our refactoring journey. The journey into Chain of Responsibility allows the attendees to practice code transformations like:Merge If StatementsMerge NestedIf StatementsExtract MethodsReplace Temp with QueryMove MethodsInline MethodsExtract Class / Extract DelegateExtract Interface- Rename Methods & VariablesThe course ends up with Homework, where the participants can experience the difference between implementing additional requirements within Clean Code and within Legacy Code. This is the difference between skipping and applying Preparatory Refactoring.