Reconstruction abstract 12_large reconstruction

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.