简单的装饰模式
package decorate;public class abstractDecorateImp extends abstractDecorate {public abstractDecorateImp(IByDecorate iByDecorate) {super(iByDecorate);// TODO Auto-generated constructor stub}public void sayHello() {sayHello1();super.sayHello();sayHello2();}public void sayHello1() {System.out.println("hello1");}public void sayHello2() {System.out.println("hello2");}public static void main(String[] argv) {IByDecorate decorate = new abstractDecorateImp(new ByDecorateImp());decorate.sayHello();}}