[디자인 패턴] - Prototype
볼빵빵오춘기
Prototype 패턴Prototype 패턴은 기존 객체를 복사하여 새로운 객체를 생성하는 방식의 디자인 패턴이다.객체를 생성할 때 new 키워드로 직접 생성하는 것이 아니라, 기존 객체를 복제(clone)하여 생성하는 것이 특징이다. 예제 코드// 1. Prototype 인터페이스interface Prototype extends Cloneable { Prototype clone(); // 복제 메서드}// 2. 구체적인 Prototype 클래스class ConcretePrototype implements Prototype { private String name; public ConcretePrototype(String name) { this.name = name; }..