Dependency Injection

Spring has made dependency injection a fancy thing. It has too much complexity in the procedure of creating beans. But dependency injection itself is just a simple idea; dependency injection is injecting dependencies! Nothing more. It means if piece of code A is depended on code B then code B should be passed into A, instead of A containing B.