마케팅스프린트
[ GitHub ]

[ jungyijun@naver.com ]


  • Category
    • 마케팅 자동화
    • old posting
      • ChatGPT
      • Java
      • MySQL
      • JSP
      • Spring Framework
      • Node.js
Total
Today
Yesterday
hELLO · Designed By 정상우.
old posting/Spring Framework

[Spring] IoC 컨테이너와 빈(Bean) 그리고 ApplicationContext

2021. 6. 12. 18:40
  • Spring Framework
    • 소규모 어플리케이션 또는 기업용 어플리케이션을 자바로 개발하는데 있어 유용하고 편리한 기능을 제공하는 프레임워크
    • Spring5 부터는 Servlet기반이 아닌 WAS도 개발할 수 있다.

 

  • Spring IoC 컨테이너 (Inversion of Control)
    • 의존 관계 주입(Dependency Injection)이라고도 하며, 어떤 객체가 사용하는 의존 객체를 직접 만들어 사용하는게 아니라, 주입 받아 사용하는 방법
      • BeanFactory
      • 어플리케이션 컴포넌트의 중앙 저장소
      • 빈 설정 소스로부터 빈 정의를 읽어들이고, 빈을 구성하고 제공한다.

 

  • 빈(Bean)
    • Spring IoC 컨테이너가 관리하는 객체
    • 장점
      • 의존성 관리
      • Scope
        • Singleton
        • prototype
      • Lifecycle Interface

 

  • 빈(Bean) 설정
    • 빈 명세서
      • 빈에 대한 정의를 담고 있다.
        • 이름
        • 클래스
        • 스코프
        • 생성자 아규먼트 (constructor)
        • 프로퍼트 (setter)

 

  • ApplicationContext
    • ClassPathXmlApplicationContext (XML)
    • AnnotationConfigApplicationContext (Java)

 

  • ApplicationContext의 다양한 기능
    • BeanFactory
    • 메시지 소스 처리 기능(i18n)
    • 이벤트 발행 기능
    • 리소스 로딩 기능
    • ...
저작자표시
'old posting/Spring Framework' 카테고리의 다른 글
  • [Spring] Environment
  • [Spring] 빈의 스코프
  • [Spring] Component Scan 과 Component
  • [Spring] @Autowired
마케팅스프린트
마케팅스프린트
쿠팡, 스마트스토어 자동화 솔루션

티스토리툴바