Skip to content

[Question] Obtain return from another module #12

@emenegro

Description

@emenegro

I have a problem dealing with the return of some info from a module that had been presented by another module. In my case I have two modules, Map and Search. The MapView notifies that it wants to search an address, so the MapPresenter begins the actions to show the Search module. Inside the Search module I make a text search, obtain the results, show it and select one. That selection has to be returned to the Map module. How can I achieve that?

Taking into account, and please correct me if I'm wrong, that the communication inter-module has to be achieved only via routing (not jumping between modules with notifications, closures and so on), I implemented this scenario:

viper-flow-chart
(Sorry, maybe a sequence diagram would be better)

MapWireframe implements the regular interface but also another one I called MapModuleInput, so I pass to the SearchWireframe a MapWireframe implementing that interface when I begin the search action (blue).

After that, in the red flow, in the SearchView I begin the search case, it obtains the results from the interactor, etc. After that the results are presented and the user selects one (green), so the selected result is returned to the map via the MapModuleInput interface.

So, is that correct?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions