• 2022-06-09
    以下哪些设计模式都可以用来将抽象部分与实现部分分离()
    A: 适配器模式(Adapter)
    B: 装饰模式(Decorator)
    C: 桥接模式(Bridge)
    D: 代理模式(Proxy)
  • C

    内容

    • 0

      ()模式通过提供与对象相同的接口来控制对这个对象的访问。 A: 适配器(Adapter) B: 代理(Proxy) C: 组合(Composite) D: 装饰器(Decorator)

    • 1

      将一个类的接口转换成客户希望的另一个接口。这句话是对下列哪种模式的描述()。 A: 策略模式(Strategies) B: 桥接模式(Bridge) C: 适配器模式(Adapter) D: 单例模式(Singleton)

    • 2

      以下()模式不属于创建型模式。 A: 单例模式(Bridge) B: 工厂方法模式(FactoryMethod) C: 策略模式(Strategies) D: 抽象工厂模式(Decorator)

    • 3

      用于增加对象功能的设计模式是______;用于限制对象访问的设计模式是______。 A: Adapter B: Decorator C: Delegation D: Proxy

    • 4

      在某一系统的设计过程中发现:已有的两个设计类需要互相通信,但接口不一致。此时我们可以考虑使用 GoF 设计模式中的( )来解决。 A: 状态(State)模式 B: 装饰(Decorator)模式 C: 适配器(Adapter)模式 D: 命令(Command)模式