Skip to content

Commit

Permalink
Update workspace.xml and Observer.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenphuc22 committed Feb 2, 2024
1 parent 9afe826 commit b028023
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 18 deletions.
40 changes: 22 additions & 18 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions Writerside/topics/Observer.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,34 @@ graph LR

## Cấu trúc

```mermaid
classDiagram
class Subject {
-observers : Observer[]
+attach(observer : Observer) : void
+detach(observer : Observer) : void
+notify() : void
}
class Observer {
+update() : void
}
class ConcreteSubject {
+state : String
+getState() : String
+setState(state : String) : void
}
class ConcreteObserver {
+update() : void
}
Subject <|-- ConcreteSubject
Observer <|-- ConcreteObserver
ConcreteSubject "1" --> "*" ConcreteObserver : notifies
```

Các thành phần trong Observer Pattern:

- Subject: đối tượng chủ thể cần theo dõi. Nó duy trì danh sách các Observer và thông báo cho chúng khi trạng thái thay đổi.
Expand Down

0 comments on commit b028023

Please sign in to comment.