Push Down

From Wikipedia, the free encyclopedia
Jump to: navigation, search

In software engineering, Push Down refactoring involves moving a method from a superclass into a subclass. Compare the following Java classes before and after the Push Down refactor is applied:

   public class SuperClass{
       void methodA() {
           //do something        
       }
   
       void methodB() {
           //do something else
       }
   }
   
   public class SubClass extends SuperClass {
       void methodC() {
           //do something
       }
   }

After the Push Down refactor is applied:

   public class SuperClass{
       void methodA() {
           //do something        
       }
   }
   
   public class SubClass extends SuperClass{
       void methodB() {
           //do something
       }
   
       void methodC() {
           //do something else
       }
   }

See also[edit]

Pull Up refactoring