본문 바로가기

디자인패턴3

Design Pattern ] Singleton Pattern Singleton Real-World Analogy The government is an excellent example of the Singleton pattern. A country can have only one official government. Regardless of the personal identities of the individuals who form governments, the title, “The Government of X”, is a g refactoring.guru Singleton Pattern Class가 하나의 인스턴트를 갖게 하는 동시에 액세스를 제공할 수 있게 하는 패턴 (제가 갠적으로 좋아하는 패턴입니다. 왜냐면 구현이 간단하걸랑요!ㅎ) Problem Single.. 2020. 7. 2.
Design Pattern] Builder Builder Say you have a constructor with ten optional parameters. Calling such a beast is very inconvenient; therefore, you overload the constructor and create several shorter versions with fewer parameters. These constructors still refer to the main one, passing s refactoring.guru 빌더 패턴(Builder Pattern) 객체의 생성 방법과 표현 방법을 분리한다 johngrib.github.io Builder Pattern - 복잡한 객체를 단계별로 구성하는 디자인 패턴 - 객체의 생성.. 2020. 7. 2.
Design Pattern] Factory Method Factory Method / Design Patterns / Creational Patterns Factory Method Also known as: Virtual Constructor Intent Factory Method is a creational design pattern that provides an interface for creating objects in a superclass, but allows subclasses to alter the type of objec refactoring.guru ♬ Factory Method란? Factory Method는 수퍼 클래스에서 오브젝트를 작성하기 위해 인터페이스를 제공합니다. 이 때 어떤 클래스의 인스턴스를 만들지는 '서브클래스에서 결정'합니.. 2020. 6. 27.