일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- hdfs
- Storm
- Clean Code
- apache storm
- SBT
- design pattern
- DDD
- Spring Boot
- Java
- 엘라스틱서치
- Hbase
- elasticsearch
- Spring XD
- 도메인주도설계
- elastic search
- intellij
- docker
- Spring Batch
- scala
- 인텔리J
- 일본 백패킹
- nginx
- 구마모토 백패킹
- Spring
- Gradle
- Angular2
- hadoop
- 스프링 배치
- 제주
- Linux
Archives
- Today
- Total
욱'S 노트
Strategy - 알고리즘 교체 하기 본문
반응형
When Using It
알고리즘 구현 부분을 교체 하고 싶을때
Class Diagram
Caution
특별한 주의사항은 없다.
알고리즘 구현 부분을 교체 하고 싶을때
Class Diagram
public interface Strategy {
public void algorithmInterface();
}
public class ConcreteStrategy implements Strategy {
@Override
public void algorithmInterface() {
}
}
public class Context {
private Strategy strategy;
public Context(Strategy strategy) {
this.strategy = strategy;
}
public void contextInteface() {
strategy.algorithmInterface();
}
}
Caution
특별한 주의사항은 없다.
반응형
'Methdology > Design Pattern' 카테고리의 다른 글
Chain of Responsibility - 처리자 연결하기 (0) | 2012.04.25 |
---|---|
Vistor - 데이터 구조를 방문하기 (0) | 2012.04.25 |
Template Method - 구체적인 수행을 하위로 위임하기 (0) | 2012.04.24 |
Iterator - 순환 구조 만들기 (0) | 2012.04.23 |
Flyweight - 만들어 놓고 공유하기 (0) | 2012.04.18 |