뚝딱뚝딱 코딩 기록_

  • 홈
  • 태그
  • 방명록

Strategy 1

[디자인 패턴] 전략 패턴 (Strategy Pattern) / 자바스크립트

전략 패턴 (Strategy Pattern) 동일한 계열의 알고리즘들을 개별적으로 캡슐화하여 상호 교환할 수 있게 정의하는 패턴 하나의 클래스가 많은 행동들을 정의하고, 클래스 연산 안에서 복잡한 다중 조건문의 모습을 취하는 경우 사용 독립적으로 원하는 알고리즘 선택하여 사용 클라이언트에 영향 없이 알고리즘 변경 예제 // Strategy Interface class MovableStrategy { constructor(strategy) { this.way = strategy.way; } move() { console.log(`${this.way}를 통해 이동합니다.`) } } // Concrete Strategies class RailStrategy extends MovableStrategy { con..

STUDY/CS 2023.01.09
이전
1
다음
더보기
프로필사진

👇 ez1n's Github 👇 https://github.com/ez1n

  • CATEGORY (113)
    • PROJECT (6)
    • STUDY (89)
      • Javascript & Typescript (6)
      • React & React Native (28)
      • Next js (4)
      • Flutter (1)
      • Algorithm (41)
      • CS (9)
    • RECORD (18)

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

Archives

Calendar

«   2025/09   »
일 월 화 수 목 금 토
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

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

  • Github

티스토리툴바