Hello,
How does one go about injecting Decorators?
Is it possible to do the following:
interface PlaceController {
void goto()
}
class PlaceControllerImpl implements PlaceController {
...
}
class SecurePlaceController implements PlaceController {
PlaceController inner;
public SecurePlaceController(PlaceController b){
this. inner = b;
}
void goto(){
if(x)
inner.goto()
else
foo()
}
}
class ConsumerCodeSomewhere {
PlaceController somePlaceController;
}
So i want the ConsumerCodeSomewhere to be injected with the SecurePlaceController that in turn is injected with whatever implementation of PlaceController was defined. My design goal would be to not have the SecureModule know which class is implementing the PlaceController interface.
Regards,
Mats