How to communicate application modules?

26 Views Asked by At

There are several modules in the application. The modules contain data that are synchronized from an external service, i.e. when synchronizing, you need to place data in several modules. How to approach the issue of communication between the synchronization module and other modules (synchronization has its own module because for each resource it is possible to block synchronization and manage which properties can be synchronized, so I treat it as part of the business)? In other words, the question is which module should be treated as the master module:

  1. treat synchronization as a module that uses the api of other modules and performs operations on them (because in total, synchronization as I understand it is a composite of several smaller atomic business operations (using the product example: create a new one if it doesn't exist, then add or remove features, etc.). ) Then the slave modules don't know that a synchronization is being done, they just perform several different operations as I mentioned earlier
  2. Each module has a handler for the synchronization where the synchronization module is contacted which communicates if a synchronization can be done or which properties can be synchronized

Any other ideas?

How do I find the answer to the question which module is master and which is slave?

0

There are 0 best solutions below