-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Is this Object Mapping or Domain Logic? #268
Comments
Maybe you can create one use case with observables? I dont know how to implement this but my idea would be to invoke both observables and merge them . |
Hi, |
I prefer solution 1, because image url belongs to current business model, thus the UseCase should return full model (with image as well). Having extra fields in that model is not a problem, because in Presenter layer, you must convert that business model into a clean UI model (with just image url but not extra fields) (as BufferApp did) |
Hi, maybe someone can help me.
I'm discussing with my co-workers about follow problem:
We have an UseCase with fetches any AWS Endpoint which delivers an object, containing several fields and an unresolved key. This key has to be resolved to an image url. To get this url we have to fetch another endpoint with this key. My question is how to do this correctly with clean architecture? In our mind there are several options:
But am I allowed to talk to an other service which is on the same clean architecture layer (green layer of the clean architecture picture) (Option3)? In my opinion actually not, because I'm also not allowed to talk from presenter to any other service. But we are allowed to call UseCases in repositories or other services (such as services laying in the infrastructure package) (Option4)
Speaking in a metaphor: We do have 2 tables in a database. The first one contains partially the data we want and in the second there are the resolved image urls. What we want to do now is a join between these tables to get the all the necessary data (Which is the data from table 1 with the resolved key from table 2)
Hope my problem is clear and thank you for any help :)
The text was updated successfully, but these errors were encountered: