I ran into some Java code at work today :
public interface A {
public static interface AObj {
String toXml();
int getCode();
}
public static interface AMap {
String toXml();
int blah();
}
...
}
I have not encountered having static interfaces embedded in an existing interface before. It doesn't make much sense. Can someone comment on :
a) Is this good design practice b) What the benefits are to this vs Having individual interface files. c) This was written by a c++ programmer, i get the impression they're trying to re-create namespaces. If that's the case, why not just use packages ?
Any comments most welcome.
Regards, Alistair.