리루
1. Annotation을 이용한 Spring 설정 - Application.xml을 java의 annotation으로 변경(MemberConfig.java 파일이 application.xml을 대신해 Spring Container와 bean 객체 생성). - @Configuration Annotation 사용.(해당 자바파일은 Spring Container를 만드는데 사용될 것이라는 것을 명시) - xml 내의 객체는 java 파일 내에서 함수 형태로 표현된다.- --> public StudentDao studentDao() { return new StudentDao(); } --> 여기에서 public StudentDao studentDao() 위에다가 @Bean - Properties 가 있는 내용..
1. Bean life cycle - GenericXmlApplicationContext ctx = new GenericXmlApplicationContext("classpath:applicationContext.xml"); 선언 시, Spring Container가 메모리 상에 생성되고 Bean 객체 생성 및 주입. - ctx.close() 시, Spring Container가 Bean 객체와 함께 소멸됨. 2. Interface를 이용한 Bean 객체 생성되는 과정에서, 소멸되는 과정에서 어떠한 작업 하기. - 생성되는 과정 : Interface InitializingBean (e.g. db연결, network 설정 등)- AfterPropertiesSet() 구현 - 소멸되는 과정 : Interfa..
1. DI의 이해 - 배터리 일체형 장난감(배터리 포함 장난감 기능 객체) vs 배터리 분리형 장난감(장난감 기능 객체 + 배터리 객체) - 객체를 따로 개발해서 붙이고 떼는 것을 쉽게한다. - 객체지향 프로그램의 유연성 - 객체를 모두 독립시킴(Interface 사용) - 프로그램의 확장, 유지보수의 유연성(객체지향의 특성) 2번은 공장에서 배터리 생성 없이 만든다.*3번은 공장에서 배터리를 기본적으로 하나 넣어주고, 사용자가 바꿀 수 있다. - StudentDao와 StudentAssembler- StudentRegisterService, StudentModifyService, StudentDeleteService, StudentSelectService는 StudentDao에 의존(Assembler ..