(1) 限制了創(chuàng)建類的實(shí)例數(shù)量,而 (2) 將一個(gè)類的接口轉(zhuǎn)換成客戶希望的另外一個(gè)接口,使得原本由于接口不兼容而不能一起工作的那些類可以一起工作。
(1)A、命令模式(Command)
B、適配器模式(Adapter)
C、策略模式(Strategy)
D、單例模式(Singleton)
(2)A、命令模式(Command)
B、適配器模式(Adapter)
C、策略模式(Strategy)
D、單例模式(Singleton)