-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cấu trúc lại template theo Layered Architecture #33
Comments
hiện tại thì code của mình, em thấy nó cũng chia ra đc theo cấu trúc xử lý riêng nhất định Nhưng cái mình cần làm trong task này có phải là cấu trúc lại hết tất cả theo dạng kiểu này k chị? hay chỉ cấu trúc lại 1 số phần nào đó? Vì em đang tìm 1 cái sample nào đó để refer và cấu trúc theo cho đỡ sai, 2 links tài liệu trên họ chỉ nói về tư tưởng lý thuyết chứ k đề cập 1 sample cho mình dễ hình dung nhỉ |
@duoctvd vậy em làm số 2 trước đi. |
Phần M trong MVC thì cũng đã chia ra ok rồi, còn phần VC thì còn hơn lung tung xíu
Còn mấy cái này thì thuộc V (view or presenter): duoctv-trainning/src/components/templates/admin/news/list.tsx Lines 69 to 80 in e1d8115
Đối với presenter thì chỉ nhận props truyền vào rồi hiển thị ra view chứ không có mấy bước xử lý tạo hàm này nọ, mấy cái nào phức tạp sẽ thuộc xử lý của container. Cách làm là em sẽ tách list.ts ra như sau
|
Nội dung cần làm
Cấu trúc lại template theo Layered Architecture:
https://martinfowler.com/bliki/PresentationDomainDataLayering.html
https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html
Sử dụng path aliases để tránh sử dụng
../../
ở import pathduoctv-trainning/src/components/templates/admin/news/list.tsx
Lines 10 to 12 in 8205062
Tài liệu tham khảo: https://nextjs.org/docs/advanced-features/module-path-aliases
The text was updated successfully, but these errors were encountered: