首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 其他相关 >

Refactoring-Improving the Design of Existing Code——学习札记(7)

2012-06-20 
Refactoring-Improving the Design of Existing Code——学习笔记(7)Chapter 12 Big Refactorings(1)Tease A

Refactoring-Improving the Design of Existing Code——学习笔记(7)

Chapter 12 Big Refactorings

(1)Tease Apart Inheritance

You have aninheritance hierarchy that is doing two jobs at once. Create two hierarchiesand use delegation to invoke one from the other.

Refactoring-Improving the Design of Existing Code——学习札记(7)

(2)Convert Procedural Design to Objects

You have codewritten in a procedural style. Turn the data records into objects, break up thebehavior, and move the behavior to the objects.

Refactoring-Improving the Design of Existing Code——学习札记(7)

(3)Separate Domain from Presentation

You have GUIclasses that contain domain logic. Separate the domain logic into separatedomain classes.

Refactoring-Improving the Design of Existing Code——学习札记(7)

(4)Extract Hierarchy

You have a classthat is doing too much work, at least in part through many conditionalstatements. Create a hierarchy of classes in which each subclass represents aspecial case.

Refactoring-Improving the Design of Existing Code——学习札记(7)

热点排行