Why would both a parent and child class implement the same interface?

As I understand interfaces (and my experimentation has reinforced), there is no purpose to having both the parent and the child implement the same interface.

No. Technically, it is completely redundant.

It does however document the fact that you intend SoapFacadeImpl to be a SoapFacade and it ensures that you get a compile error, if you (or someone else) decides to remove implements SoapFacade from the base class.

You see this pattern everywhere in the standard Java Collections API. ArrayList implements List even though its base class (AbstractList) already, does. Same holds for HashSet / AbstractSet and the Set interface.

Leave a Comment