知识卡片

普通读书笔记卡 · 4361.c

默认同步通信再按约束改异步

理解等级:中级

原书建议在可行时先用同步通信,因为设计、实现和调试通常较直接;当吞吐、弹性或可靠性要求使等待响应代价过高,再采用异步消息。异步也引入数据同步、顺序、竞态和调试难题。这个“默认”是作者的选型启发,不是禁止事件驱动;须结合调用链和业务完成语义重新判断。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    参考来源

    - 位置:《Fundamentals of Software Architecture》原书第19章《Choosing the Appropriate Architecture Style》(阅读计划第22项,单元03;源文件:`OEBPS/ch19.html`) - 结论依据:原书明确给出同步默认建议,并比较异步的收益与同步、竞态及调试代价;末句限定适用范围。 - 原始内容:Because synchronous communication presents fewer design, implementation, and debugging challenges, we recommend defaulting to synchronous when possible, and using asynchronous communication only when necessary.