design templates – iOS MVV ™ application with multiple ViewModels and how they can talk to each other

It develops an iOS application and its basic architecture is a MVV ™ design model. Using coordinators for navigation logic.

I have the situation, where I have a complex user interface with different components. It is obvious that I have to modularize my design and create several ViewModels for different subsections or views of the user interface. All of these elements are associated with a parent view.

My question is: where should I keep these ViewModel references?

I have the following options. Help me choose the right approach among these.

1). Having a parent view allows this parent view to retain these references to these child ViewModels and to pass updates between them.

2). Have a parent ViewModel. Match these child ViewModels to this parent ViewModel and manage the ViewModel child updates in ParentViewModel and pass them to the view.

3). Allows the coordinator to have these references to the ViewModels child and to manage updates between them in the coordinator and switch to view.

Or is there another standard practice than this one? Please help me to have a clear path here.

Any suggestions with some examples will be more useful.

Do we need templates if we use ViewModels?

Why do we need models when we could:
1) Get only the data (to display)
2) Fill the ViewModel with these data
3) Pass this ViewModel in the view

wpf – Why can ViewModels not communicate with each other?

Can someone explain concretely why it is not desirable that ViewModels communicate directly with other models of view? It seems to me that for virtually all UX applications, there will be a "root" view (with its ViewModel) and that any other view will be launched from that view / ViewModel, or from a subview / viewModel .

The recommendation seems to be that any communication between ViewModels takes place via a message bus or an event aggregator, but I can not help thinking that it is excessive. For example, suppose an application allows users to define different profiles and perform other actions based on the current profile. In this example, the main window depends on something that manages the management of the profiles. Obviously, I do not want to force ProfileManagerViewModel to depend on MainViewModel, but it seems to me that just creating an interface (for example, IProfileManager) is isomorphic when sending a message is on a bus or an aggregator. And if these are isomorphic, the interface is much easier to implement and maintain.

Even if it is not completely isomorphic, it seems to me a YNGNI situation: in which scenarios can I take advantage of the use of an event aggregator on an interface and what is the probability that my application will encounter these scenarios over its expected life? I would expect that the usual case is that if my interface has to be modified in any way (whether my interface is a C # interface or an event that I use to signal), both ViewModels will have to be modified anyway.

So what do I miss here? The only case I can think of is if other viewModels were interested, for example. My example's ProfileManager is starting, but I do not expect this to be a common situation in most applications. Of course, if using event aggregators does not add complexity, then this whole thing probably does not make much sense, but I think most people would see a standard interface solution drastically easier to use. follow and reason.