装饰模式

     装饰模式(Decorator)最常见的就是JDK中的关于文件流的处理。

     DataInputStream dis = = new DataInputStream(new BufferedInputStream(new FileInputStream("test.txt")));

     

     装饰模式的类图如下:

     


原文地址:https://www.cnblogs.com/lnlvinso/p/3872110.html