学习笔记,原文链接 https://refactoringguru.cn/design-patterns/bridge
可将一个大类或一系列紧密相关的类拆分为抽象和实现两个独立的层次结构, 从而能在开发时分别使用。层次结构中的第一层 (通常称为抽象部分) 将包含对第二层 (实现部分) 对象的引用。


TV和Radio都实现了Device接口,可用自己需要的BasicRemote 或是 AdvancedRemote直接控制device

学习笔记,原文链接 https://refactoringguru.cn/design-patterns/bridge
可将一个大类或一系列紧密相关的类拆分为抽象和实现两个独立的层次结构, 从而能在开发时分别使用。层次结构中的第一层 (通常称为抽象部分) 将包含对第二层 (实现部分) 对象的引用。
TV和Radio都实现了Device接口,可用自己需要的BasicRemote 或是 AdvancedRemote直接控制device