I'm refactoring some code, abstracting functionality from a subclass to a helper class, but I found that I need methods from the superclass in the helper class.
I was wondering if there is a design pattern that can help me to do this. Or any other suggestions.
public class Notification(){
public void printMessage(String k, String str){
//Some code
}
}
public class NotificationImpl1 extends Notification(){
ErrorHelper helper = new ErrorHelper();
helper.showMessage("test");
}
public class ErrorHelper(){
public void showMessage(String msg){
// need to call printMessage() here
}
}
Thanks in advance.