728x90 반응형 PrototypePattern1 [Design Pattern]Prototype Pattern이란? Prototype Pattern이란? 패턴 내에서 객체의 생성을 제공한다. 객체 생성이 높은 비용으로 수 많은 요청을 하는경우나 비슷한 객체를 지속적으로 생성해야 할 때 사용한다. prototype pattern은 원래의 객체로부터 clone()을 사용하여 새로운 객체를 만들며 각 객체에 따라 데이터 수정이 가능하다. 예제 public class Users implements Cloneable { private List userList; public Users() { userList = new ArrayList(); } public Users(List list) { this.userList = list; } public void loadData () { userList.add("ssw"); userLis.. 2019. 1. 17. 이전 1 다음 728x90 반응형