author and iconoclast
posted 11 years ago
Imagine an interface or abstract class that can have only a few meaningful implementations. For example, a "Gender" interface that has two (or perhaps three) different possible specializations. In this kind of situation, it can make sense to put all the possible implementations inside the superclass/interface; then, for example, the classes would be named "Gender.Male" and "Gender.Female", which seems rather natural.