Push Down

From Wikipedia, the free encyclopedia

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

Pull Up refactoring

This article is issued from Wikipedia. The text is available under the Creative Commons Attribution/Share Alike; additional terms may apply for the media files.