"Reconstruction of improving existing code _ Design" study notes - to subvert your cognitive reconstruction

About Books

"Reconstruction of existing code to improve the design _" super classic masterpiece of engineering software, with another masterpiece "design mode" and that "soft workers Hutch"
author Martin Fowler is an internationally renowned object-oriented analysis and design, UML, patterns one of the founders of experts, agile development methods and other aspects of
the book vividly describes the reconstruction of the principles and practices

Laziness is one of the virtues of a programmer, never because this book makes you diligent.

Chapters Introduction

  • Chapter 1, an example is to show some common design flaws and to reconstruct it into a more qualified object-oriented programming
  • Chapter 2 tell me what is reconstruction , why reconstruction , when reconstruction
  • Chapter 3 tell me how to find the "Code of bad taste ."
  • Chapter 4 tells me the importance of test cases, test-driven development
  • Chapter 5-12 explicit reconstruction techniques
  • Chapters 13-15 are invited to a number of technologies and applications to share the experience of other masters reconstruction

What is reconstruction

Once my eyes "reconstruction"

Instant work more than four years, I have reconstructed the perception is: a group of people organized, to spend a month or two or even longer, before a poorly designed system, or a large number of business code stripped solution coupling. A group of apes reconstruction program organized in the particular case of full-time behavior.

Now my eyes "reconstruction"

First overthrow once cognitive! Once the reconstruction it is not called reconstruction, called rewrite . It should be reconstructed in their daily work, and frequently does not require special arrangements for the time period, the job does not require full-time staff. Every time I see a beautiful remodeling is not enough, not precise enough, not enough time to modify its robust code readability higher, better scalability, enhanced security, lower degree of coupling, the number of repetitions of a less ... day-to-day work.

Official in the eyes of the "reconstruction"

  • Reconstruction (noun): The software for adjusting the internal structure, without changing the purpose of observing the behavior of the premise software, improve its understandability, modified to reduce its cost.
  • Reconstruction (verb): using a series of reconstruction technique, under the code without changing the external behavior of the premise, to make changes to the code to improve the internal structure of the program.

Why reconstruction

  • Disorganized
  • Eliminate duplication
  • Easy to understand
  • Find BUG
  • accelerate

When reconstruction

The first time you do something just do it; the second will do something similar disgusted, but no matter what you can still do it; the third time to do something like that, you should consider reconstruct ;

  • When you add a reconstruction function;
    the current design of the code I can not let easily add features I need
  • When the repair reconstruction error;
    when the code is not clear to allow you to easily navigate to the time BUG
  • When the reconstruction of the code review;
    when the code review found a better design time

When not reconstructed

  • When the project is close to the final delivery deadline
  • When the project life cycle coming to an end

Where reconstruction

Code "bad taste"

Test Driven Development

  • Ensure that all tests are fully automated, allowing them to check their test results;
    writing test code takes time, but it allows you to save more time, unless you write test code is not good enough
  • When you receive a bug report, it should be added a test case to expose this bug;
    add more tests: all the things to do to observe classes, and then test for any case of a possible failure of any one function
  • BUG purpose of the test is to find out now or in the future that may arise;
  • Consider the boundary conditions that can go wrong, the test focuses on getting that
  • Do not test can not capture all of the BUG not write the test because the test can indeed bug can capture the most
    reasonable to take the time to grasp most of BUG, very poor life better grasp of all BUG

Here we are just introduced before Chapter 4 as for a later chapter I think it is not a simple description of a blog can hope planted a primer, if you have the idea that you deserve.

I think this is a worthwhile book promotion like the whole team, not a person like agility to perform can be successful, but the whole team and the whole company are recognized, agile in order to demonstrate the implementation of its real power.

Enclose within the team share the PPT Download:
CSDN: https://download.csdn.net/download/zhibo_lv/10872055

Published 18 original articles · won praise 45 · views 110 000 +

Guess you like

Origin blog.csdn.net/zhibo_lv/article/details/85167174