Click here to Skip to main content
15,884,472 members
Articles / General Programming / Architecture

Decorator Design Pattern in Java

Rate me:
Please Sign up or sign in to vote.
4.75/5 (4 votes)
11 Feb 2013CPOL3 min read 56.5K   247   5  
It explains decorator design pattern in detail with example.
    package org.arpit.javapostsforlearning.designpattern;  
      
    abstract class RoomDecorator implements Room{  
      
      protected Room specialRoom;  
      
      public RoomDecorator (Room specialRoom) {  
        this.specialRoom= specialRoom;  
      }  
      
     public String showRoom() {  
        return specialRoom.showRoom();  
      }  
    }  


By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
India India
I am a java developer and blogger.Love to connect with people interested in java,programming or blogging.You can visit my blog at http://java2blog.com/

Comments and Discussions