Articles »

Suppose you have a God class that is full of ifs and case statements, or boolean flags. Many refactorings try to segregate responsibilities in smaller entities: methods, subclasses, or collaborators.

One option for starting to break up the class is based on inheritance. The end result is many little subclasses, each modelling a special case which was submerged in the original giant class.
Posted by girish.r 915 days ago (http://css.dzone.com)
Discuss  | Bury | Tweet This | Tagged: practical php refactoring extract hierarchy
Add To 

Who Voted for this Story

Comments

No one has commented on this article yet.

Log in to comment or register here.