Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- IntelliJ
- vue.js
- HandlerMethodArgumentResolver
- aws
- Stream
- 리눅스
- CompletableFuture
- 친절한 SQL 튜닝
- @TransactionalEventListener
- Spring Cloud Netflix
- 백명석님
- 마이크로 서비스
- 자바 ORM 표준 JPA 프로그래밍
- javascript case
- ksql
- multipart테스트
- 자바 ORM 표준 JPA 프로그래밍 정리
- java
- git
- #docker compose
- 원격 브랜 삭제
- intellij 핵심 단축키
- Linux
- ksqldb
- findTopBy
- JPA
- 리팩토링 2판
- intellij 즐겨찾기
- intellij favorites
- @Transactional Propagation
Archives
- Today
- Total
시그마 삽질==six 시그마
Facade pattern 본문
The facade pattern (also spelled façade) is a software-design pattern commonly used in object-oriented programming. Analogous to a facade in architecture, a facade is an object that serves as a front-facing interface masking more complex underlying or structural code. A facade can:
-improve the readability and usability of a software library by masking interaction with more complex components behind a single (and often simplified) API
-provide a context-specific interface to more generic functionality (complete with context-specific input validation)
-serve as a launching point for a broader refactor of monolithic or tightly-coupled systems in favor of more loosely-coupled code
source: https://en.wikipedia.org/wiki/Facade_pattern
파사드는 복잡한 구조의 코드를 숨기는 인터페이스로 사용되는 객체를 의미
보통 추상화된 고차원 객체의 메소드안에 여러 저차원 객체의 메소드를 숨겨 simple하게 구성
클라이언트는 복잡한 내부구조를 알 필요가 없음
/* Complex parts */
class CPU {
public void freeze() { ... }
public void jump(long position) { ... }
public void execute() { ... }
}
class HardDrive {
public byte[] read(long lba, int size) { ... }
}
class Memory {
public void load(long position, byte[] data) { ... }
}
/* Facade */
class ComputerFacade {
private final CPU processor;
private final Memory ram;
private final HardDrive hd;
public ComputerFacade() {
this.processor = new CPU();
this.ram = new Memory();
this.hd = new HardDrive();
}
public void start() {
processor.freeze();
ram.load(BOOT_ADDRESS, hd.read(BOOT_SECTOR, SECTOR_SIZE));
processor.jump(BOOT_ADDRESS);
processor.execute();
}
}
/* Client */
class You {
public static void main(String[] args) {
ComputerFacade computer = new ComputerFacade();
computer.start();
}
}
souce :https://en.wikipedia.org/wiki/Facade_pattern
'프로그래밍 > 디자인패턴' 카테고리의 다른 글
옵저버 패턴(Observer Pattern) (0) | 2020.04.25 |
---|---|
컴퍼지트 패턴(Composite pattern) (0) | 2020.04.24 |
데코레이터 패턴(Decorator pattern) (0) | 2020.04.24 |
스테이트 패턴(State pattern) (0) | 2020.04.24 |
전략 패턴(Strategy Pattern) (0) | 2020.04.24 |
Comments