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