Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- Design Pattern
- 싱글톤
- 추상팩토리패턴
- ㅋㅁ
- 팩토리 메소드
- El
- 추상 팩토리
- 옵저버 패턴
- a
- F
- Abstract Factory
- PrototypePattern
- 함수형프로그래밍
- 프로토타입 패턴
- 디자인패턴
- Kotlin
- 빌터패턴
- Functional Programming
- ㅓ
- Singleton
- r
- 디자인패턴 #
- Observer Pattern
- designPattern
- factory method
- 코틀린
- builderPattern
Archives
- Today
- Total
목록factory method (1)
오늘도 더 나은 코드를 작성하였습니까?
Factory Method Pattern 팩토리 메소드 패턴 (feat. kotlin)
정의Factory method는 부모(상위) 클래스에 알려지지 않은 구체 클래스를 생성하는 패턴이며. 자식(하위) 클래스가 어떤 객체를 생성할지를 결정하도록 하는 패턴이기도 하다. 부모(상위) 클래스 코드에 구체 클래스 이름을 감추기 위한 방법으로도 사용한다. - 객체를 이용하는 코드로 부터 객체를 생성하는 코드를 분리하여, Loose Coupling(느슨한 결합)을 이루어낸다.- 상속(inheritance)에 많이 의존합니다.- 객체생성의 구현부를 하위 클래스에 위임. 장점- 코드에서 작동할 정확한 객체의 Type을 모르는 경우 사용한다. - 독립적으로 Product 생성 코드를 쉽게 확장할 수 있습니다.- 기존의 코드를 수정하지 않고 새로운 product를 추가하는데 쉽다.- product 생성코드를..
디자인패턴/생성패턴
2024. 6. 2. 23:27