일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- SBT
- hadoop
- intellij
- elastic search
- Hbase
- Java
- docker
- 제주
- DDD
- elasticsearch
- Spring Batch
- Linux
- nginx
- design pattern
- 스프링 배치
- Gradle
- Angular2
- Spring
- hdfs
- scala
- Clean Code
- Domain Driven Design
- 도메인주도설계
- Spring XD
- spark
- apache storm
- 엘라스틱서치
- Storm
- Spring Boot
- hibernate
- Today
- Total
목록Methdology/Design Pattern (24)
욱'S 노트
When Using It 언어로 문제를 해결하기 Class Diagram Sample Code public interface AbstractExpression { public void interprete(Context context); } public class TerminalExpression implements AbstractExpression { @Override public void interprete(Context context) { String token = context.currentToken(); if (!"go".equals(token) ) { new NonTerminalExpression().interprete(context); } else { System.out.println("g..
When Using It 명령을 클래스로 표현하고 싶을때 Class Diagram Sample Code public interface Command { public void execute(); } public class ConcreteCommand implements Command { private Receiver receiver = new Receiver(); @Override public void execute() { receiver.action(); } } public class Receiver { public void action() { System.out.println("Action Performed!!!"); } } public class Invoker { private List comma..
When Using It 조건에 따른 상태 자체를 클래스로 표현하고 싶을때 Class Diagram Sample Code public interface State { public void handle(Context context, boolean condition); } public class ConcreteState implements State { @Override public void handle(Context context, boolean condition) { if (condition) { System.out.println("ConcreteState Handled."); } else { context.setState(new ConcreteState2()); } } } public class Con..
When Using It 자신의 상태의 저장본을 만들기 Class Diagram Sample Code public class Memento { private String state; public String getState() { return state; } public void setState(String state) { this.state = state; } } public class Organitor { private String state; public Memento createMemento() { Memento memento = new Memento(); memento.setState(state); return memento; } public void setMemento(Memento memen..
When Using It 자신의 상태에 변화가 일어났을 경우 Observer들에게 통보하기 Class Diagram Sample Code public interface Observer { public void update(Subject subject); } public class ConcreteObserver implements Observer { @Override public void update(Subject subject) { System.out.println(subject.getState()); } } public abstract class Subject { private List observers = new ArrayList(); public void attach(Observer observ..
When Using It 다수의 객체에 통합적인 지시를 내리기 위한 패턴. 클래스의 기능들을 분할하여 세분화된 클래스로 내렸을때, 세분화된 클래스간의 통신이 필요할때 유용하다. Class Diagram Sample Code public interface Mediator { } public class ConcreteMediator implements Mediator { private Colleague colleague; private Colleague colleague2; public void initializeColleague() { colleague = new Colleague(); colleague2 = new Colleague(); colleague.setMediator(this); colleagu..
When Using It 다수의 처리자들을 연결하고 싶을때 Class Diagram Sample Code public abstract class Handler { private Handler nextHandler; public abstract boolean handleRequest(); public final void setNext(Handler handler) { this.nextHandler = handler; } public final void process() { if (handleRequest() == false) { if ( nextHandler != null) { nextHandler.handleRequest(); } } } } public class ConcreteHandler exte..
When Using It 특정한 데이터 구조 가진 오브젝트를 방문하면서 처리를 하고 싶을때 Class Diagram Sample Code public interface Element { public void accept(Visitor visitor); public void add(Element element); public List getChildren(); } public class ConcreteElement implements Element { private List children = new ArrayList(); @Override public void accept(Visitor visitor) { visitor.visitConcreteElement(this); } @Override publi..
When Using It 알고리즘 구현 부분을 교체 하고 싶을때 Class Diagram Sample Code 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.algorithmInter..
When Using It 하위클래스에 구현을 위임하고 싶을때 Class Diagram Sample Code public abstract class AbstractClass { public abstract void templateMethod1(); public abstract void templateMethod2(); public abstract void templateMethod3(); public void execute() { templateMethod1(); templateMethod2(); templateMethod3(); } } public class ConcreteClass extends AbstractClass { @Override public void templateMethod1() {}..