OLD_달려라/소프트웨어공학5 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. GUI Swing ] Factory Method Pattern Button public interface Button { void render(); void onClick(); } HTMLButton public class HtmlButton implements Button { public void render() { System.out.println(" Test Button"); onClick(); } public void onClick() { System.out.println("Click ! button says - 'Hello'"); } } WindowsButton import java.awt.Color; import java.awt.FlowLayout; import java.awt.Font; import java.awt.event.ActionEvent; im.. 2020. 7. 1. Design Pattern] Abstract Factory Abstract Factory Solution The first thing the Abstract Factory pattern suggests is to explicitly declare interfaces for each distinct product of the product family (e.g., chair, sofa or coffee table). Then you can make all variants of products follow those interfaces. For refactoring.guru 추상 팩토리 패턴 (Abstract Factory Pattern) 서로 관련성이 있는 다양한 객체를 생성하기 위한 인터페이스를 제공한다 johngrib.github.io ♬ Abstract Fa.. 2020. 6. 28. 이전 1 2 다음