Note: This essay is inspired by the "Refactoring and Patterns" section seventh, section 7.6, with the command to replace the conditional scheduler.For command not to do too much explanation, here I looked for two examples, for some of the garden friends to see: command Example 1 command Example 2.Conditional Scheduler: My understanding of this noun is that it is a relatively simple combination of the choice structure and the relatively independent bu
This article is in the study summary, welcome reprint but please specify Source: http://blog.csdn.net/pistolove/article/details/42679983 We all know that classes tend to become bloated because they take on too much responsibility. In this case, it is common to use the "refinement class" approach to separate part of the responsibility. If a class becomes "irresponsible", it is generally used in an "inline class" approach to incorporate it into another class. If a class uses another class, it is g
This article is in the study summary, welcome reprint but please specify Source: http://blog.csdn.net/pistolove/article/details/42497857 the decomposition temporary variable is described in the previous article . This article describes the refactoring technique of "removing the assignment of parameters". Let's learn this refactoring technique.straight to Discovery: The code assigns a value to a parameter.W
The PHP framework can be a single entry, fully object-oriented, completely based on the MVC pattern of classes. However, we face a large number of old code, or even the new code, is not entirely consistent with object-oriented principles, consistent with design patterns. Small application is no harm. But if the face of large-scale applications, it must be a big pain!!
What to do? A lot of people always face this, PHP code needs refactoring. (Of course
The PHP framework can be a single entry, fully object-oriented, completely based on the MVC pattern of classes. However, we face a large number of old code, or even the new code, is not entirely consistent with object-oriented principles, consistent with design patterns. Small application is no harm. But if the face of large-scale applications, it must be a big pain!!
What to do? A lot of people always face this, PHP code needs refactoring. (Of course
The project is finished, and the skeleton is basically clear.CodeRebuild and optimization, sort out several points, and welcome to supplement and correct them. Thank you very much!
1. Try not to use public. For classes or methods that must be made public, make sure they are at least one of the following:A. Data objects, including databases and script templatesB. unified access portal for public modulesC. Protocol definitions for broad scopes such as
PHP talks about refactoring-improving the design of existing code-5 simplifying function calls. The mind map introduces several articles in the previous series. I pay more attention to one of PHP's Miscellaneous "refactoring-improving the design of existing code" to reorganize your function, but I don't think I can clarify the mind map.
Introduction
Which of the first few articles I pay more attention?
I generally use strongly typed languages, such as Java or C + +. But I know a lot of systems are using weakly typed scripting languages, like watercress.
I've tried weak type development, but it's hard to maintain later, and it's almost impossible to refactor.
Is there any other way to avoid this problem, or can it support a robust refactoring?
I have been on the dynamic language Building system Maintenance mode is more curious, ask the great God enli
System refactoring requires that every step of code modification cannot change the external behavior of the software. Therefore, all methods in system refactoring are equivalent changes of code. The reconstruction process is like performing an equivalent transformation of the formula step by step in a mathematical problem. After a series of equal transformation, although the final result is different from t
been very much, here I do not describe too much, interested students can see my Android Refactoring Tour: architecture, where we finally chose the MVP as our development framework, MVP Has a lot of benefits, but ultimately it makes us choose it because it's easy for the average developer to get started, and it can also make the business boundaries of our Activity clear.Refused God ActivityDuring the years of development, it is often possible to see t
Directory"SSH Advanced path" Step by step refactoring container implementation Spring Framework-starting with a simple container (eight)"SSH Advanced path" Step by step refactoring container to implement spring framework--two schemes to solve the "intrusive" management of containers for components--active lookup and control inversion (ix)"SSH Advanced path" Step by step
Directory"SSH Advanced path" Step by step refactoring container implementation Spring Framework-starting with a simple container (eight)"SSH Advanced path" Step by step refactoring container to implement spring framework--two schemes to solve the "intrusive" management of containers for components--active lookup and control inversion (ix)"SSH Advanced path" Step by step
Directory"SSH Advanced path" Step by step refactoring container implementation Spring Framework-starting with a simple container (eight)"SSH Advanced path" Step by step refactoring container to implement spring framework--two schemes to solve the "intrusive" management of containers for components--active lookup and control inversion (ix) (not updated)"SSH Advanced path" Step by step
variables*extract: Extract-I personally prefer to translate to "refine"*duplicate: CopyingSplit: AnatomyVariable: variableFactor: Factors, factorRefactoring PrinciplesFirst, what is refactoring?Noun form: An adjustment to the internal structure of software, which aims to improve the understanding and reduce the cost of modification without changing the performance of the software.Verb form: Use a series of refact
I.Reconstruction principles
1.Definition of refactoring
refactoring ( TERM ): an adjustment to the internal structure of the software , the purpose is not to change " Software-aware behavior " prerequisites , improved comprehensibility , reduce the modification cost .
refactoring ( verb ): using a series of
Agile development emphasizes the need to refactor code frequently. In the development process, often is the development and the reconstruction alternately. Short-term refactoring can make subsequent development and maintenance easier. I think that code refactoring can be divided into logical refactoring and data structure reconstruction.
)--general refers to temporary variables
*extract: Extract-I personally prefer to translate into "refinement"
*duplicate: Copy
Split: Anatomy
Variable: variable
Factor: Factor, factor
Refactoring Principles
First, what is refactoring?
Noun form: An adjustment to the internal structure of software, in order to improve its understandable type and reduce its modification cost without changing the observe
1. Preface(Download source code, usage instructions, demo, see: Https://github.com/wangfupeng1988/wangEditor)I did a bootstrap-based Rich text editor--wangeditor and posted it on GitHub (Https://github.com/wangfupeng1988/wangEditor) a while ago. Writing an article in the blog Park (http://www.cnblogs.com/wangfupeng1988/p/4088229.html) also received a lot of attention.The reason for this refactoring is for the following reasons.
First, Bootstr
Series content: This content is part of the series: Making development automation
Over the past few years, I've seen a lot of the source code for many projects, from beautifully designed to like tape-bound code. I have written new code and maintained the source code of other developers. I like to write new code, but I also like to use some of the existing code, to simplify it in some way or to extract duplicate code into a common class. In my early career, many people thought it would be ineffic
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.