Push Down
Encyclopedia
In software engineering
Software engineering
Software Engineering is the application of a systematic, disciplined, quantifiable approach to the development, operation, and maintenance of software, and the study of these approaches; that is, the application of engineering to software...

, Push Down refactoring
Refactoring
Code refactoring is "disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behavior", undertaken in order to improve some of the nonfunctional attributes of the software....

 involves moving a method
Method (computer science)
In object-oriented programming, a method is a subroutine associated with a class. Methods define the behavior to be exhibited by instances of the associated class at program run time...

 from a superclass into a subclass. Compare the following Java
Java (programming language)
Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities...

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
}
}
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK