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 |
Tags
- Kotlin
- k8s
- Observer Pattern
- Codility
- BubbleSort
- GKE
- Python
- 알고리즘
- java
- golang
- Singleton Pattern
- 그리디
- 백준
- Dynamic Programming
- 피보나치
- go
- 파이썬
- easy
- kubernetes
- cpu scheduling
- github
- KAKAO
- Top-down
- GCP
- mobaXTerm
- Backjoon
- LeetCode
- docker
- Programmers
Archives
- Today
- Total
목록감시자 (1)
To Be Developer
[Design Pattern] Observer Pattern (옵저버 패턴)
Observer Pattern (감시자) 객체지향 프로그래밍에서 객체에 감시자(Observer) 들을 등록을 하여 객체의 상태변화가 발생 하였을 때 자동으로 알리도록 설정하는 패턴 주로 이용되는 곳이 유튜브와 같이 구독자 알림과 같은 곳에서 옵저버 패턴이 적용된다. import abc class Observer(object): __metaclass__ = abc.ABCMeta # 알림 역할을 하는 추상 메서드 @abc.abstractmethod def notify(self, videos): pass # 구독자 알림 class Subscriber(Observer): def __init__(self, subId): self.subId = subId def notify(self, video): print("{..
Design Pattern
2019. 4. 20. 23:46