일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- docker
- hdfs
- spark
- 제주
- apache storm
- DDD
- hibernate
- SBT
- nginx
- 엘라스틱서치
- Linux
- design pattern
- scala
- 도메인주도설계
- intellij
- Storm
- elastic search
- Spring
- Spring Batch
- Spring XD
- Clean Code
- 인텔리J
- 스프링 배치
- Gradle
- Hbase
- elasticsearch
- hadoop
- Angular2
- Java
- Spring Boot
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 |