Ports are not abstracting adaptors
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, node.js
- Lĩnh vực
- backend, backend-api-design
Hướng nghiên cứu
Bắt đầu với ports/Repository.js ở dòng 6, được liên kết trong issue, và lần theo cách contract của nó được ghép nối với schema DynamoDB. Sử dụng phần thảo luận về contract input/output của issue để đánh giá ranh giới giữa logic miền và các adaptor; công việc được xem là hoàn tất khi các thay đổi schema của adaptor không còn yêu cầu các thay đổi tương ứng trong miền.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I used internally this sample for training with my team, and they got confused by the responsibility of ports. They struggled to understand the abstraction and to translate it to typescript. This issue is an attempt to make things more clear for developers new to hexagonal architecture.
I believe ports should enforce a contract between Domain logic and Adaptors, and protect changes to happen on domain logic when the implementation details present in Adaptors change.
Here the port is not only enforcing the contract but tied to the adaptor on itself.
for example, the Repository port is tied to the implementation of a DynamoDB table with a defined schema.
If we happen to change the database schema (changing key names, moving to a single table design, etc..), the port is not protecting the Domain logic from the implementation detail in the Adaptor. Moving to a single table design will imply changing Adaptor/ports and domain logic.
If we were in a typed language, the port would be represented by an Interface, that defines the contract (Input/Output), and the adaptor would implement this interface (the contract).
- Ngôn ngữ chính
- JavaScript
- Star
- 159
- Fork
- 27
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue tương tự
-
Notifications pagination accepts NaN and negative LIMIT/OFFSETCó thể đã có người làm @Senthil455 đã nhận hôm nay. Đang mởBUGS MEDIUM
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
elixpo/blogs.elixpo#419 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
immich-app/immich#32426 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
automated issue report
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 70/100
lirantal/discoprint#45 ·
Maintainer thường phản hồi trong vòng 1 ngày