제어의 역전(IoC): Inversion of Control


<aside> 1️⃣ IOC란?

</aside>

<aside> 2️⃣ 예시

</aside>

@Service
public class BookService {
    private final BookRepository bookRepository;

    @Autowired
    public BookService(BookRepository bookRepository) {
        this.bookRepository = bookRepository;
    }

    // 서비스 메소드들...
}

따라서 IoC는 코드의 결합도를 줄이고 유연성과 확장성을 증가시키는 데 큰 도움이 된다. 이는 소프트웨어 설계의 SOLID 원칙 중 하나인 **Dependency Inversion Principle (의존 역전 원칙)**과도 깊은 연관이 있다.