Sorry guys, I should have clarified the fact that the modified method is abstract in Father. Then if the method signature changes, all its implementations in SonX shall also change(at least the signature, though the implementation may stay still).
Now the question should be asked like following: Say I have the abstract class Father, and three(or more) of his children class Son1, Son2 and Son3. Now I have to change one method, in other words, add an argument to one abstract method of Father. However, I will have to change all the implemented methods(the modified abstract method in Father) in SonX, which costs too much. The change to the signature of the method in SonX is essential cause the clients are interacting with SonX and the clients shall invoke the new version of the method.
So my question is: is there any design pattern suitable for such a situation in which the interfaces will change?
Thanks.
Aucun commentaire:
Enregistrer un commentaire