Spring1 [Spring] IoC 컨테이너와 설정 방법 📌 DI(Dependency Injection)의존성 주입은 객체를 생성할 때, 그 객체가 의존하고 있는 다른 객체들을 외부에서 주입해 주는 디자인 패턴이다.interface MessageService { void sendMessage(String message, String receiver);}class EmailService implements MessageService { public void sendMessage(String message, String receiver) { // 이메일 보내기 로직 }} 위 코드에 있는 MessageService를 MyApplication에서 의존하고 있다면 다음과 같은 코드를 작성할 수 있다. class MyApplication .. 2024. 5. 1. 이전 1 다음