tags:

views:

10

answers:

1

Hi friends,

I have a tricky question on interface. Please try to give me a solution for it.

Scenario: I have written an interface with five methods. Also I have implemented more than 100 classes using this interface. Now, I need to add one more method to the interface. Consequently, I will need to define the same method in all classes. How can I avoid this???

Please reply...

Thanks, Akif

+1  A: 

Could you avoid adding a method to the interface by instead creating a new interface which inherits from that first interface and then only changing the classes you need that new method on? Hence, if foo didn't need the new method, leave it alone but if bar did, change it to the new interface.

wheaties
+1 because this must work in almost every lang.
fabrik