Extract Class

From CSSEMediaWiki
(Difference between revisions)
Jump to: navigation, search
m (Reverted edits by Ebybymic (Talk); changed back to last version by RobertLechte)
 
Line 1: Line 1:
----
 
<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://egebyromedu.co.cc Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page]=
 
----
 
=[http://egebyromedu.co.cc CLICK HERE]=
 
----
 
</div>
 
 
This is a common refactoring method, given this moniker in [[Martin Fowler]]'s [[Refactoring]] book.  
 
This is a common refactoring method, given this moniker in [[Martin Fowler]]'s [[Refactoring]] book.  
  

Latest revision as of 03:18, 25 November 2010

This is a common refactoring method, given this moniker in Martin Fowler's Refactoring book.

When a class gets larger and more complex, we can manage this complexity by breaking the large class into multiple smaller classes. As an Example, mapping software may contain Country objects. If the map simply stores the name of the country, its population, and the name of its capital city, then the class is small and manageable. However if the class is expanded to store a larger amount of information, the class will become unwieldy.

If for example we wish to store multiple historical population figures for each country, it's sensible to extract this information into a separate Population object. The provides separation of concerns, avoids the Divergent change smell, and keeps both objects small.

Personal tools