Inline Method

From CSSEMediaWiki
(Difference between revisions)
Jump to: navigation, search
(New page: This is basically the opposite of the Extract Method where you replace method calls with the body of code Sometimes the body of a method is as clear as the method name....)
 
Line 5: Line 5:
  
 
==References==
 
==References==
http://sourcemaking.com/refactoring/inline-method
+
* [http://sourcemaking.com/refactoring/inline-method sourcemaking.com]

Revision as of 00:34, 29 July 2009

This is basically the opposite of the Extract Method where you replace method calls with the body of code

Sometimes the body of a method is as clear as the method name. Replacing the method call with the body of the method can help get rid of needless indirection.
Another time to use the inline method is when you have a group of badly factored methods. By using the inline method you can construct one big method then reextract the methods.

References

Personal tools