publicclassMemberApp {publicstaticvoidmain(String[] args) {// AppConfig appConfig = new AppConfig();// MemberService memberService = appConfig.memberService();// AppConfig에 있는 환경 설정 정보를 가지고 해당 객체를 빈으로 스프링 컨테이너에 다 넣어준다.ApplicationContext applicationContext =newAnnotationConfigApplicationContext(AppConfig.class);// 해당 빈을 가져온다.MemberService memberService =applicationContext.getBean("memberService",MemberService.class);// 빈은 AppConfig에서 설정한 구현체를 끌고 온다.Member member =newMember(1L,"memberA",Grade.VIP);memberService.join(member);Member findMember =memberService.findMember(1L);System.out.println("new member = "+member.getName());System.out.println("findMember = "+findMember.getName()); }}