ts23 [TS Design Patterns] 생성 패턴 - 빌더 Builder - Lets you construct complex objects step by step - Allows us to produce different types and representations of an object using the same construction code - Suggests that us extract the object construction code out of its own class and move it to separate objects called builders - 예시 /** * The Builder interface specifies methods for creating the different parts of * the Product objects. .. 2023. 10. 21. [TS Design Patterns] 생성 패턴 - 팩토리 메서드 Factory Method (Virtual Constructor) - Provides an interface of creating objects in a superclass, but allows subclasses to alter the type of objects that will be created - Suggests that we replace direct object construction calls (using the new operator) with calls to a special factory method - Creator, Sub Classes - Sovles the problem of creating product objects without specifying their concret.. 2023. 10. 21. [TS Design Patterns] 생성 패턴 - 추상 팩토리 Abstract Factory - lets you produce families of related object without specifying their concrete classes - Product families and their variants - The first thing the Abstract Factory pattern suggests is to explicitly declare interfaces for each distinct product of the product family - Then We can make all variants of products follow those interfaces - The next move is to declare the Abstract Fact.. 2023. 10. 19. 이전 1 ··· 3 4 5 6 다음 반응형