Czasami przy korzystaniu ze wzorca strategii stwierdzam, że niektóre implementacje algorytmów nie wymagają tej samej listy parametrów.Różne parametry w wzorcu strategii
Na przykład
public interface Strategy{
public void algorithm(int num);
}
public class StrategyImpl1 implements Strategy{
public void algorithm(int num){
//num is needed in this implementation to run algorithm
}
}
public class StrategyImpl2 implements Strategy{
public void algorithm(int num){
//num is not needed in this implementation to run algorithm but because im using same
strategy interface I need to pass in parameter
}
}
Czy istnieje inny wzorzec projektowania należy używać?