装饰模式

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

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

     

     装饰模式的类图如下:

     

 


posted on 2014-07-27 22:48  lnlvinso  阅读(124)  评论(0编辑  收藏  举报