the thing is we should always program to an interface. now if i wanted to insert a method specific to class B.. would this be a time to redesign? cause all old code would program to anInterface. wats the best way to tackle such a situation?
Then let class B implement this interface. Any client code that needs to use methodSpecificToClassB() will have to use this new interface . Any code which does not need methodSpecificToClassB() can continue using the old one. [ November 27, 2005: Message edited by: Jim Yingst ]
Programming to an interface is often a good idea, but beware that you go too far (making your code unnecessarily long and complex) if you make an interface for every single class you write...