I’ve heard that implementing an interface of constants is an anti-pattern ’cause such interfaces provide implementation details to the classes (which is not a purpose of an interface). But what about having an inner interface of constants in a class? Is this a bad practice?
EDIT:
I mean I don’t want to implement it, just to use it’s constants.
An interface’s sole purpose is to be implemented. So, using an interface to group constants is still bad practice, even if you don’t implement it. Just use a class to put the constants:
If these connstants are tightly coupled with a given class, put them directly in this class. If they’re common to several classes, put them in an external class as shown above.