Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Code refactoring
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Transformations=== Transformations modify the syntactic representation of a program. Some modifications alter the semantics or structure of the program in a way which improves its flexibility or robustness. Such modifications require knowledge of the problem domain and intended logic, and thus are infeasible to automate. Modifications exist which make the program easier to read and modify but which to not alter the underlying logic of the program; these transformations can be automated. * Techniques that allow for more [[Abstraction (computer science)|abstraction]] ** [[Field encapsulation|Encapsulate field]] β force code to access the field with getter and setter methods ** [[Type generalization|Generalize type]] β create more general types to allow for more code sharing ** Replace type-checking code with state/strategy<ref>{{cite web| url = http://refactoring.com/catalog/replaceTypeCodeWithStateStrategy.html| title = Replace type-checking code with State/Strategy}}</ref> ** Replace conditional with [[Polymorphism (computer science)|polymorphism]]<ref>{{cite web| url = http://refactoring.com/catalog/replaceConditionalWithPolymorphism.html| title = Replace conditional with polymorphism}}</ref> * Techniques for breaking code apart into more logical pieces ** Componentization breaks code down into reusable semantic units that present clear, well-defined, simple-to-use interfaces. ** [[Extract class]] moves part of the code from an existing class into a new class. ** Extract method, to turn part of a larger [[method (computer science)|method]] into a new method. By breaking down code in smaller pieces, it is more easily understandable. This is also applicable to [[Function (programming)|function]]s. * Techniques for improving names and location of code ** Move method or move field β move to a more appropriate [[Class (computer science)|class]] or source file ** Rename method or rename field β changing the name into a new one that better reveals its purpose ** Pull up β in [[object-oriented programming]] (OOP), move to a [[Superclass (computer science)|superclass]] ** Push down β in OOP, move to a [[Subclass (computer science)|subclass]]<ref name="refactoring.com"/> * Automatic [[clone detection]]<ref>{{cite conference |first1=M. |last1=Bruntink |first2=A. |last2=van Deursen |first3=T. |last3=Tourwe |first4=R. |last4=van Engelen |title=An evaluation of clone detection techniques for crosscutting concerns |book-title=Proceedings, 20th IEEE International Conference on Software Maintenance |publisher=IEEE |date=2004 |doi=10.1109/ICSM.2004.1357804}}</ref>
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Code refactoring
(section)
Add topic