For clarity consider following design -
Interface MyIface{
myInterfaceContract(someObject);
};
Class Child1 implements MyIface{
myInterfaceContract(someObject){ //implemented }
myChild1Action(){ //implemented }
}
Class Child2 implements MyIface{
myInterfaceContract(someObject){ //implemented }
myChild2Action(){ //implemented }
}
I know how to achieve interface injection through spring annotation. doubt is - If interface based injection is done then how can I access methods directly implemented in my child class i.e. myChild1Action()/myChild2Action()
Am i doing or thinking drastically wrong?
instanceofand cast to the appropriate implementation (Child1 or Child2). The fact you're trying to do it probably means your design isn't ideal though (you should always try and code to an interface)...