Reconstruction-improving the design of existing code Martin Fowler abstract: Chapter 2 large-scale reconstruction
Features
You need to arrange your work as needed, and only need to add new functions or fix errors.
It is necessary to build consensus for the entire development team during large-scale refactoring. Realize that refactoring is in progress, and everyone should arrange their own actions accordingly.
Tease Apart Inheritance
A certain inheritance system assumes two responsibilities at the same time
Establish Two inheritance systems and enable one of them to be called through the trust relationship.
Assume that all classes at a specific level in the inheritance system and their subclass names start with the same adjectives, the system is likely to assume two different responsibilities.
ConvertProcedural Design to Objects converts procedural Design into object Design
Some traditional procedural code
Converts a data record into an object, divides a large part of behavior into small parts, and moves the behavior into related objects.
Separate Domain from Presentation separates Domain from Presentation/Display
Some GUI classes include domain logic.
Separate domain logic and establish independent domain classes for them.
Extract Hierarchy Extract inheritance system
You have a class that has done too much work, and some of the work is completed with a large number of conditional expressions.
Establish an inheritance system and use a subclass to represent a special situation.
The above refactoring involves a series of or a set of refactoring techniques mentioned in the previous chapter.
Reconstruction abstract 12_large reconstruction