Inversion of Control Principle

차노·2023년 11월 9일
0
post-custom-banner

클래스는 스스로 의존할 인스턴스를 만들면 안된다. 외부에서 주입받아 사용해야 한다.

Controller is only consuming dependencies class.

payout: pay a large sum of money from funds under one's control.
"insurers can refuse to pay out"
2. let out a rope by slackening it.
"I began paying out the nylon line"

CPU and Disk are supplied power on the computer.
The CPU(compute) and Disk(getData) module relies on PowerModule(Power Service(supplyPower()).
Computer Module (Computer Controller(run()) module relies on the CPU(CPU Service(compute()) and Disk(Disk Service(getData()) module.

post-custom-banner

0개의 댓글