Inline Method

From CSSEMediaWiki
(Difference between revisions)
Jump to: navigation, search
m (Reverted edits by Ebybymic (Talk); changed back to last version by AlexGee)
 
Line 4: Line 4:
 
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.
 
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.
  
>== Automatic Inlining ==
+
== Automatic Inlining ==
  
 
An Inline Method can also refer to automated inline functionality in some languages. For example in C++ a method can be declared using the inline keyword. A method declared inline will upon complication be copied into the locations it is called from. This reduces overhead by eliminating function calls but increases binary size. Inlines are often used in high performance low level code.
 
An Inline Method can also refer to automated inline functionality in some languages. For example in C++ a method can be declared using the inline keyword. A method declared inline will upon complication be copied into the locations it is called from. This reduces overhead by eliminating function calls but increases binary size. Inlines are often used in high performance low level code.
 
----
 
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 
----
 
=[http://oqefoqekedo.co.cc Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page]=
 
----
 
=[http://oqefoqekedo.co.cc CLICK HERE]=
 
----
 
</div>
 
  
 
==References==
 
==References==
 
* [http://sourcemaking.com/refactoring/inline-method sourcemaking.com]
 
* [http://sourcemaking.com/refactoring/inline-method sourcemaking.com]

Latest revision as of 03:22, 25 November 2010

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.

Automatic Inlining

An Inline Method can also refer to automated inline functionality in some languages. For example in C++ a method can be declared using the inline keyword. A method declared inline will upon complication be copied into the locations it is called from. This reduces overhead by eliminating function calls but increases binary size. Inlines are often used in high performance low level code.

References

Personal tools