Aria Templates Forums
event linkage between submoduleControllers - Printable Version

+- Aria Templates Forums (http://ariatemplates.com/forum)
+-- Forum: Public forums (/forumdisplay.php?fid=3)
+--- Forum: Support (/forumdisplay.php?fid=8)
+--- Thread: event linkage between submoduleControllers (/showthread.php?tid=183)



event linkage between submoduleControllers - kanwar - 18 February 2014 18:14

Hello,

I have multiple submodule Controllers and i am raising the event in one submodule and want to listen to it in another submodule. How is it possible to achieve it. Or if not possible, any workaround possible.

Regards,

Kanwar


RE: event linkage between submoduleControllers - Olaf - 19 February 2014 14:52

Hi there!

Your question is a typical app design pattern using AT (that we probably should document better.)

So, when you have multiple modules in your app, communication works as follows:
- parent controllers can call children controllers directly
- children controllers are unaware of what happens around them but can either: modify data in the model or raise events.

If you choose to work with events, the most common pattern is to have a parent controller that acts as an orchestrator for his children. Practically, that means having this global parent listen to all children events and call whatever other child accordingly.
You could also work with a dedicated part of the data model that could be shared among children controllers and use listeners to react to changes.

Hope that helps.