What is the purpose of using an empty interface that extends it to Java?

I'm just starting to support a Java MVC project that uses the Java Guice Framework.

In almost all the code, the first developers passed an empty interface model as a parameter, expanding another interface.

Here is the first interface:

public interface FooModel extends ModelInterface {

}

And another interface:

 public interface ModelInterface {
        public void addListener(FooListener fooListener);
        void setFoo(boolean blop);
        boolean isFoo();
    }

It makes no sense to me.

Is there a good reason / pattern to use an empty interface in Java? Maybe for Guice?

+5
source share
3 answers

" ". - , ( , Guice - ).

+7

, , , . , java.lang.Cloneable Serializable.

+3

It can be used to indicate a class for a specific use.

Example: IRequiresSessionState

+2
source

All Articles