Accepted
We need a way for modules in our modular monolith to communicate synchronously.
We will use ModuleClients for synchronous inter-module communication.
- Clear module boundaries
- Compile-time type safety
- Easier refactoring and testing
- Additional code for client interfaces
- Small performance overhead
public interface IInventoryModuleClient
{
Task<Result<StockModel>> StockFindOne(string tenantId, string id);
Task<Result<IEnumerable<StockModel>>> StockFindAll(string tenantId);
// ...
}
Another module can use this client to interact with the module synchronously.