Hi : I have a class defining the following method :
public String abstract getAnimalName();
And a subclass
class Ralph extends Animal
{
public String getAnimalName(){return "RALPH";}
}
I want "Ralph"'s getAnimalName to be static, since there is only one, stateless version of Ralph's name.
Thus, I want to implement the getAnimalName statically, whilst still satisfying the interface. Is this possible ? Maybe, is there a way I can use a dependency injection or AOP technique to provide the object implementation by proxying the static one at run time ?
The obvious solution (of having an object scope method wrap a static method) is a little to boiler-plateish for my tastes.