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?
source
share