摘要:
Transfer Data vs. Transfer Control – Short Note Transfer data means: “Here is some information.” One component sends or returns values (objects, messa
阅读全文
posted @ 2026-01-03 15:29
tortelee
阅读(5)
推荐(0)
摘要:
Software Interfaces Are Two‑Way Contracts When many engineers hear “interface,” they think only about what a component offers to the outside world: th
阅读全文
posted @ 2026-01-03 14:36
tortelee
阅读(4)
推荐(0)
摘要:
设计接口时,是根据使用方的需求来决定什么API需要暴露的。当你增加一个接口,那么你就需要维护与使用者之间的约定(接口名,接口参数)。 使用者会对你的接口有依赖,一旦接口发生变化或者错误,那么使用者也会受影响。 最重要的几个设计原则: 最小惊喜原则: 接口要名字清楚,让别人很清晰的知道接口是做什么的,
阅读全文
posted @ 2025-11-29 21:16
tortelee
阅读(15)
推荐(0)
摘要:
偶然看到一篇文章, https://chuna2.787528.xyz/buguge/p/19055703 对这篇文章的设计进行了更改。 原来设计的类图 和流程图 : 原有设计的优缺点: 优点 实现了解耦 核心优势:业务层(插件)不依赖于上层应用的具体实现,而是依赖于一个抽象的接口 (TransferC
阅读全文
posted @ 2025-09-21 12:00
tortelee
阅读(39)
推荐(0)
摘要:
Folly Expected 错误处理设计指南 概述 Folly的Expected<Value, Error>采用了一种强制性的错误处理设计,通过类型系统和运行时检查来确保程序员正确处理错误情况。这种设计将业务错误和程序逻辑错误明确区分,强制上层调用者遵循安全的访问模式。 底层设计机制 核心设计原理
阅读全文
posted @ 2025-09-07 12:13
tortelee
阅读(38)
推荐(0)
摘要:
好的,我来举一个具体的例子,帮助你理解 interface、element、resource 和 architecture 之间的关系。 场景:设计一个用户管理系统的接口 背景 假设我们正在设计一个用户管理系统,系统中有两个主要的模块: 用户服务模块(User Service):负责用户的注册、登录
阅读全文
posted @ 2025-06-29 20:15
tortelee
阅读(6)
推荐(0)
摘要:
Abstract common services 减少依赖时候,有一个策略,是Abstract common services. Where two modules provide services that are similar but not quite the same, it may be
阅读全文
posted @ 2025-05-11 17:29
tortelee
阅读(43)
推荐(0)
摘要:
what is Intermediary in software design? The "Use an Intermediary" tactic is a software design approach where a middle layer (intermediary) is introdu
阅读全文
posted @ 2025-05-05 20:12
tortelee
阅读(35)
推荐(0)
摘要:
Definition This is the definition from wikipedia. In software systems, *encapsulate* refers to the bundling of data with the mechanisms or methods tha
阅读全文
posted @ 2025-05-05 15:29
tortelee
阅读(34)
推荐(0)
摘要:
How Layers Should Be Realized The matter of how layers should be realized is determined by the client-server nature of the relationship between an app
阅读全文
posted @ 2025-01-21 22:39
tortelee
阅读(54)
推荐(0)