[디자인 패턴] 의존성주입 예시
public class UserServiceFactory { public UserService getInstance(){ return new UserService(new UserDataRepositoryImpl()); } } class UserService{ private UserDataRepository udr; UserService(UserDataRepository udr){ this.udr = udr; } public void persistUser(User user){ udr.save(user); }...
최근 댓글