The Synchronous Module Pattern SMD
is the immediate execution of subsequent logic regardless of whether the module exists or not, enabling immediate referencing to the module in module development. Modularization involves breaking down complex systems into highly cohesive, loosely coupled modules. The Synchronous Module Pattern does not belong to the conventional definition of the 23
design patterns, but is generally considered as a broad architectural design pattern.
The Synchronous Module Pattern is typically used to address the following scenario: as the functionality of a page increases, the business logic of the system becomes more complex. Features developed by multiple people often end up being coupled together. Sometimes, when the project manager assigns a requirement to be implemented by multiple people, it often leads to a queue for modification due to certain functionalities being coupled with the code of multiple individuals.
By using modularization to break down complex systems, this problem can be effectively addressed. In order to achieve modular development, a module manager is needed to manage the creation and scheduling of modules. Module calls are divided into two categories: the first category is synchronous module scheduling, which is relatively simple to implement and does not require consideration of asynchronous module loading. The second category, asynchronous module scheduling, is more complicated and can handle module loading scheduling.