Programming241 AOP(Aspect Oriented Programming: 관점 지향 프로그래밍) OOP (Object Oriented Programming: 객체 지향 프로그래밍) 12. AOP (Aspect Oriented Programming: 관점 지향 프로그래밍) ==> @Transactional 이 AOP 기술로 만들어짐. (성공: commit , 실패: rollback) https://docs.spring.io/spring-framework/docs/5.2.25.RELEASE/spring-framework-reference/core.html#aop1> 개념 브라우저 ----------> A서블릿 ----------> 서비스 ----------> DAO ----------> DB (핵심기능:필수 (핵심기능 (핵심기능 .. 2024. 7. 2. 프로파일(Profile) 11. 프로파일(Profile) https://docs.spring.io/spring-boot/docs/2.7.18/reference/htmlsingle/#features.external-config.files.profile-specific1> 개요 - 실제로 개발할 때는 개발환경, Q/A 환경, .. ,Production 환경 다양한 환경을 개발자가 선택적으로 정해서 환경을 맞출 수 있는 개념. ex> # 개발환경 Application.java ----------> DeptServiceImpl ------------> DeptDAO -------------> H2(데이터베이스, 인메모리) # Production환경(배포) Application.java ----------> DeptSe.. 2024. 7. 2. 초기화 및 cleanup 작업 처리(@PostConstruct & @PreDestroy) 10. 초기화 및 cleanup 작업 처리 https://docs.spring.io/spring-framework/docs/5.2.25.RELEASE/spring-framework-reference/core.html#beans-factory-lifecycle1> 개요 - 빈(bean)이 생성되고 의존성 주입(DI) 이후의 초기화 작업 및 자원반납(cleanup)작업처리가 가능하도록 지원. 2> @PostConstruct 와 @PreDestroy 이용 ex> @PostConstruct public void init() { // 초기화 작업 } @PreDestroy public void clean() { // cleanup 작업 } packag.. 2024. 7. 2. 빈의 scope 9. 빈의 scope 1> 개념 빈 생성후에 ctx.getBean() 를 여러번 헀을때 반환되는 빈의 스코프를 의미한다. 기본적으로 bean은 한번만 생성되고 getBean() 을 여러번 했을때 동일한 인스턴스를 반환한다.(싱글톤) ex> DeptServiceImpl s = ctx.getBean("xxx", DeptServiceImpl.class); DeptServiceImpl s2 = ctx.getBean("xxx", DeptServiceImpl.class); 2> scope 값 종류 @Scope(value=상수값) ex> @Scope(value = ConfigurableBeanFactory.SCOPE_SINGLETON) // 기본 @Scope("singleton").. 2024. 7. 2. 이전 1 ··· 5 6 7 8 9 10 11 ··· 61 다음