Hi Friends,
I got this interview question in one of the interviews.
Is IOC possible with DI?
I answered Yes.
DI is Injecting Dependancies.
Since the process of DI is managed by the container and not us , the flow is reversed hence it is Inversion Of Control.
So ideally, The
Servlet which instantiated by container, whose lifecyle methods are managed by the web container, is also IOC? but not DI?
Am I correct? Please explain.
Regards,
-Pankaj.
PANKAJ SHET
B.Sc.(I.T.), S.C.J.P., S.C.W.C.D., PGDAC(CDAC)