How to implement a software layer
摘要: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
阅读全文
【面向接口编程(IOP)典型场景】底层组件如何实现回调通知上层应用系统? 另外一种实现方式
摘要:偶然看到一篇文章, https://www.cnblogs.com/buguge/p/19055703 对这篇文章的设计进行了更改。 原来设计的类图 和流程图 : 原有设计的优缺点: 优点 实现了解耦 核心优势:业务层(插件)不依赖于上层应用的具体实现,而是依赖于一个抽象的接口 (TransferC
阅读全文
设计一个接口
摘要:设计接口时,是根据使用方的需求来决定什么API需要暴露的。当你增加一个接口,那么你就需要维护与使用者之间的约定(接口名,接口参数)。 使用者会对你的接口有依赖,一旦接口发生变化或者错误,那么使用者也会受影响。 最重要的几个设计原则: 最小惊喜原则: 接口要名字清楚,让别人很清晰的知道接口是做什么的,
阅读全文
Software Interfaces Are Two‑Way Contracts
摘要:Software Interfaces Are Two‑Way Contracts When many engineers hear “interface,” they think only about what a component offers to the outside world: th
阅读全文
Transfer Data vs. Transfer Control – Short Note
摘要:Transfer Data vs. Transfer Control – Short Note Transfer data means: “Here is some information.” One component sends or returns values (objects, messa
阅读全文