You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Clean Code Discussion
How can I return JSON response from presenter, in this diagram I don't know how presenter can present the ResponseModel. Should presenter return another model (ex: RestModel) or just return the ResponseModel from the Interactor and let Controller handle it.
Łukasz Duda
unread,
Dec 31, 2019, 4:06:40 AM12/31/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Clean Code Discussion
Hi, I suppose there is no one correct answer. There are situations in which you prefer to return the response model, in others you prefer to call action and cause some behavior. For instance In case of integration with different system I often choose to return data structure.
The diagram shows that the interactor calls methods on the presenter, who probably prepares the view model based on the arguments passed in calls, e.g. based on the response model.
Below is an example of a controller that gets a view model from the presenter.
I can imagine service, where controler doesn't prepare view and returns simple data structure, some kind of response model. It could be JSON. I got the feeling, that REST is more about resources. I'm not sure, that trying to map behaviors to resources pays of.
In another example I was trying to understand the differense between returning data structure or calling responder actions.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Clean Code Discussion
Hi,
this is something that took me a long time to figure out. If you're still interested, please see this article that I've written about Clean Architecture that explains this.