views:

546

answers:

2

I saw in the apache camel source code that

public class DefaultCamelContext extends ServiceSupport implements CamelContext, Service

My question is why this definition since

public interface CamelContext extends Service

and also

public abstract class ServiceSupport implements Service

Shouldn't it be just

public class DefaultCamelContext extends ServiceSupport implements CamelContext

?

Is the explicit 'implements Service' needed and I am missing something? Generally is there any case where this might be needed?

+2  A: 

It's not needed, but it emphasizes to anyone reading the code that it really does implement Service - it means they don't need to look at ServiceSupport to find that out.

I don't tend to do it myself, but there's nothing wrong with doing it.

Jon Skeet
+1  A: 

See this question, which is asking the same thing:

Should an interface that is inherited from base-class be implemented explicitly in subclass?

matt b