jeudi 14 décembre 2017

Override several method for same implment

i’ve method which I inherit from the base class, I’ve 5 class that inherit the method and override it but doing the same, Now I need to change all the methods to support additional scenario according to envoriment variable

//specific  implications
@Override
protected boolean prepareDirectory(Configuration configuration, Logger logger) throws Exception

//logic here as before

if(env===“global”){



//do something 

} 

}

of course I can do this if inside all the class which works but there is a better approach to overcome this since all the 5 class should use the same logic inside the new if

Aucun commentaire:

Enregistrer un commentaire