Hello,
i have written a small CustomerService (Java, Spring MVC) Clean Architecture sample project. It implements the following logic:
1. the controller create the presenter and pass the modelMap into it
2. the controller create the interactor and pass the presenter instance into it
3. the controller call the interactor (separation via his boundary)
4. the interactor read all the customer data via a entity gateway implementation from a database (separation via the entity gateway boundary)
5. the interactor call the presenter (separation via his interface)
6. the presenter convert the customer raw data to the format that we want to show to the customer and put it into the modelMap
7. the interactor finished
8. the controller finished
9. the front controller (handeled by Spring?) creates the html page, using the jsp page (the view) and the modelMap - filled by the presenter
As far as I understand, I followed all the rules from the Clean Architecture. But I don't understand, why the interactor has to call the presenter. The interactor can for eaxmple also return the raw data to the controller and then the controller can call the presenter to convert the raw data to view format. In this case, only the controller knows about the data transformation. But isn't it the job of the delivery mechanims to transform the data that we want to show to the customer?
I would be very happy if I can better understand why the interactor and not the controller should call the presenter?
Many regards,
Mike