android10 / android10/Android-CleanArchitecture

Why the domain layer is tigthly coupled to a framework dependency (RxJava) ?

Đang mở
#143 12 bình luận 14 reaction 0 người được giao Xem trên GitHub
discussion question
Ngôn ngữ chính
Java
Star
15.5k
Fork
3.3k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hi, here I am again, this time with a different concern.
Citing Uncle Bob's explanation of Use Cases:

> We also do not expect this layer (USE CASES) to be affected by changes to externalities such as the database, the UI, or any of the common frameworks. This layer is isolated from such concerns.

Your use cases depend on RxJava framework. I have to provide a Subscriber implementation in order to obtain List or a single User. I expect that a UseCase hides the implementation logic from the outside. To me, a UseCase is **Given** an id, **Return** a User.

Your case is Given an id **and a Subscriber implementation** return a User. What if at some point I don't want to use RxJava anymore? My UseCase shouldn't change! I have an id and I want a User back, but it still requires something depending on an external framework, meaning that I have to reimplement my UseCase even though nothing has changed, except for the framework it uses to accomplish the job.

Thank you @android10

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.