-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1 update template method and factory method
- Loading branch information
Showing
5 changed files
with
91 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@startuml | ||
class Creator{ | ||
|
||
+ someOperation() | ||
+ createProduct(): Product | ||
} | ||
|
||
class ConcreteCreatorA{ | ||
+ createProduct() | ||
} | ||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Factory Method | ||
|
||
- Thuộc vào nhóm chế tạo, liên quan nhiều đến việc tạo instance. | ||
|
||
|
||
- Interface Python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Template Method | ||
|
||
- Thuộc vào nhóm các pattern liên đến hành vi | ||
- Thường đóng vai trò xương sống khi code các thuật toán. | ||
- Những hàm trong class trên sẽ được override bởi class dưới | ||
|
||
Anh Thanh Niên (nghề nghiệp ) -> Hoạ sĩ | ||
-> Nhạc sĩ | ||
|
||
- Cách dùng mà sử dụng rất nhiều: code các bước tiến hành một quy trình. | ||
|
||
|
||
(Đi Đến trường) | ||
Ra khỏi nhà -> Đến trường | ||
(Ăn sáng - hook) | ||
|
||
Đi học | ||
Ra khỏi nhà -> Đến trường -> Học | ||
|
||
|
||
Đi thi | ||
Ra khỏi nhà -> Đến trường -> Thi | ||
|
||
Đi học muộn | ||
Ra khỏi nhà -> Đến trường -> Học | ||
(Ăn sáng - buông ) | ||
|
||
- REST API: query data từ database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters