The interface is implemented by thousands of classes, therefore, if changes occur in the interface, then how to reduce it

There is a scenario in which I have an X interface that has been implemented with thousands of classes. Now I want to add a new method to the X interface. So, how to make changes to the minimal way to solve the problem of method overriding in all my classes

+3
source share
4 answers

If the implementation of the method is common to all classes, perhaps abstract classbetter than interfacefor it.

If this is not the case, you will still write these methods.


(*) This was originally a comment, but I was asked to indicate it as an answer.

+7
source
  • , - ,
  • - clas
+2

( abstract extend interface) :

. , interface, () .

0

, , IntelliJ 3 ,

  • Refactor- > Push Down... - , , IntelliJ IDEA (11.0.2) , void doSomething();, Find and Replace, ,

    @Override void doSomething() {}

  • .

0

All Articles