| Refactoring |
Website Links For Code Refactoring |
Information AboutRefactoring |
| CATEGORIES ABOUT CODE REFACTORING | |
| extreme programming | |
| software engineering | |
| technology neologisms | |
|
A code refactoring is any change to a Computer Program which improves its Readability or simplifies its structure without changing its results. SOURCE CODE In ensures that refactoring does not make the code stop working. Refactoring neither fixes Bug s nor adds new functionality. Rather it improves the Understandability of the code or changes its internal Structure and Design , and removes Dead Code , to make it easier for human maintenance in the future. In particular, adding new behavior to a program might be difficult with the program's given structure, so a developer might refactor it first to make it easier, and then add the new behavior. An example of a trivial refactoring is to change a ). A more complex refactoring is to turn the code within an if block into a Subroutine . An even more complex refactoring is to replace an if Conditional with Polymorphism . While "cleaning up" code has happened for decades, the key insight in refactoring is to intentionally "clean up" code separately from adding new functionality, using a known catalogue of common useful refactoring methods, and then separately testing the code (knowing that any behavioral changes indicate a bug). The new aspect is explicitly wanting to improve an existing design without altering its intent or behavior.There are however certain problems to overcome in refactoring. It is a comparably new idea and there is not enough experience over its long term effects, thus the limitations which apply to it are not yet studied enough. Another problem area of refactoring are the databases – in today’s 3 – tiered architectures the Business Layer is strictly related to the Database Schema , which makes the refactoring impossible or very difficult. Difficulties occur also in changing interfaces – if the programmer has access to all the callers calling a specific method he might change its name and implementation, yet if there are other classes using this interface beyond the knowledge of the programmer serious problems might occur – the interface might become unusable for them. This could be solved by creating the new Method and adding the Method Call to it in the old one. ANTECEDENTS The term is by analogy with the Factorization of Number s and Polynomial s. For example, ''x''2 − x − 2 can be factored as (''x'' + 1)(''x'' − 2), revealing an internal structure that was previously not visible (such as the two roots at −1 and +2). Similarly, in software refactoring, the change in visible structure can often reveal the "hidden" internal structure of the original code. The above math example illustrates a problem of "refactoring". One form is not necessarily objectively or universally superior to the other. They each emphasize different aspects of the formula and thus their utility may vary depending on both the situation of usage and on the personality or style of the mathematician. This issue occurs in the software field where two or more professionals may have differing opinions on the ideal form of a given algorithm. Refactoring is done as a separate step, to simplify testing. At the end of the refactoring, any change in behavior is clearly a Bug and can be fixed separately from the problem of Debugging the new behavior. systems. All of these resources provide a Catalog Of Common Methods For Refactoring ; a refactoring method has a Description of how to apply the Method and Indicator s for when you should (or should not) apply the method. LIST OF REFACTORINGS Here is a very incomplete list of code refactorings. A longer list can be found in Fowler's Refactoring book. Since researchers continue to work on inventing and implementing refactorings, a complete list may never exist.
FORTH The term "factoring" has been used in the Forth community since at least the early 1980s. Chapter Six of Leo Brodie 's book '' Thinking Forth '' ( 1984 ) is dedicated to the subject. In Forth, factoring has essentially the same meaning that the Extract Method refactoring does in Extreme Programming —to break down a Function (a "word" in Forth) into smaller, more easily maintained functions. AUTOMATIC CODE REFACTORING Many software Editors and IDEs have automated refactoring support. Here is a list of a few of these editors, or so-called Refactoring Browsers .
NATURAL LANGUAGE The term ''refactoring'' originated in Computer Programming , but the concept has also been applied when modifying any text. On Wiki websites, ''refactoring'' refers to the process of rewriting and reorganizing text to shorten it while preserving content. This particularly applies to '' Discussion s'', which thus can be made accessible to people who are interested in the arguments made in the discussion, and the information to be gleaned from it, rather than the history of the discussion itself. For a contentious discussion, refactoring to the satisfaction of all parties can be challenging. : Most recently, biological engineers have begun exploring the idea of refactoring the genomes of natural biological systems in order to make living organisms easier to understand and interact with. ETYMOLOGY The first known use of the term "refactoring" in the published literature was in the article, ''Refactoring: An Aid in Designing Application Frameworks and Evolving Object-Oriented Systems'', ''Proceedings of the Symposium on Object Oriented Programming Emphasizing Practical Applications (SOOPPA)'' September, 1990, ACM by William F. Opdyke and Ralph E. Johnson William Opdyke's Ph.D. thesis on "Refactoring Object-Oriented Framework", University of Illinois, was published in 1992 [http://martinfowler.com/bliki/EtymologyOfRefactoring.html . The term "refactoring" was almost certainly used before then. As a Neologism , it is clearly a reference to mathematical Factoring . SEE ALSO
REFERENCES EXTERNAL LINKS
|
|
|