I am having a hard time trying to wrap my head around the relationship between Controllers and Presenters in Uncle Bob's Clean Architecture.
In most of his videos, he talks too little about controllers, and a fair amount about presenters. The knowledge available online isn't helping me much either, because there are too many of "my own" versions of clean architecture, which may or may not be correct.
What I am failing to understand is, most of the images, don't have a connection between the controller and the presenter, whether it is a "use arrow" or "inherits arrow", it's not there. There is, however, a single example where it's connected:
(Martin, R.C. Clean Architecture; p84)
This is the only image I can assume that there is an inheritance relation between controllers and presenters. And it makes sense to me. However, the User sits on the outer layer, and interacts with the Views layers only. So, in this sense, sending a form data would reach the controller through the presenters (due to inheritance/implementations)... is this assumption right? I couldn't find any confirmation of that, sorry if I am being a potato.
Images like this one below made me think that there is no relation between them, and are instead made through the interactors, which I am miserably failing to understand if that's the case. Because how would the controllers even be triggered if that's it? Since the interactors have no understanding of what is outside of the boundaries. AND the users can only interact with the views.
(Martin, R.C. Clean Architecture; p196)
Thanks in advance, and again, sorry if it's a dupe, I've read a lot and still am failing to wrap my head about this. So, my questions:
- Is my first assumption right? Presenters implements/extends controllers?
- If not, then, can someone explain me the data-flow with some examples?
Interesting examples I would like to understand is:
- User sends form data. Simple as that. Starting by clicking a html button (which sits in the view), passing through all the architectures, and going back to the view with a "Success/Error" msg popped at some alert dialog.
- User gets notified of a change. Instead of implementing a periodic "get" in the presenters, how would a data layer notify the available views (web/smartwatch/app/desktop) when a change happened there. Think something dangerous like, a sudden peak in the sensor data of a bridge pillar.