What is Dependency Injection? | Why | Spring

  • HitachHD implements HardDrive @Component. It makes this class a component of a spring framework, which will be generated as for the requirement.
  • HardDrive obj = new ... but dont use that. use @Autowire instead.
  • Why we need this? 1. Loose coupling 2.testing
  • to test each component or unit.
  • to test some module(laptop for example) you dont have to test 'samsung drive' or 'hitachi hard drive'. you dont have to test that object. all you have to do is test the mock class.

MEKA

Composed 191 Viments

13

Published on Nov 15, 2020

Send Viment

Comments 0

Viments for this video by others

There's no pre-existing Viments

Facebook Kakao Naver Twitter

Embed

Copy & Paste following HTML

Viment Text

Copy & Paste following Text