[디자인 패턴] 생성 패턴 - 팩토리 메소드 패턴
팩토리 메소드 패턴이란?"객체 생성"을 별도의 클래스로 분리하여 생성하게 하는 디자인 패턴을 팩토리 메소드 패턴 이라고 합니다.클라이언트에서 직접 new 키워드로 객체를 생성하는 것이 아닌 객체들을 도맡아 생성하는 클래스를 만들고, 이 클래스를 통해 객체를 생성하는 패턴으로, 해당 클래스는 "객체 생성"이라는 단 하나의 책임만 지는 것. 팩토리 메소드 패턴의 장점객체 생성을 별도의 클래스로 분리하였으니, 책임이 분리되고 객체지향적이라고 볼 수 있습니다. (단일 책임 원칙 , SRP 준수)객체 생성에 필요한 과정을 템플릿처럼 미리 구성해놓고, 객체 생성 과정을 다양하게 처리하여 객체를 유연하게 정할 수 있습니다.수정에 닫혀있고 확장에는 열려있는 OCP 원칙을 지킬 수 있다.캡슐화, 추상화를 통해 객체의 구..