1 代碼演練java
1.1 代碼演練1(未使用裝飾者模式)mysql
1.2 代碼演練2(使用裝飾者模式)react
需求:git
大媽下班賣煎餅,加一個雞蛋加一元,一個火腿兩元,如今a買一個煎餅,b買加蛋的煎餅,c買加腸加蛋的煎餅,請實現它github
煎餅類:web
package com.geely.design.pattern.structural.decorator.v1; /** * 建立煎餅類 */ public class BatterCake { /** * 獲取加的種類 * @return */ public String getDescribe(){ return "煎餅"; } /** * 計算所須要的錢 * @return */ public int cost(){ return 8; } }
煎餅雞蛋類:redis
package com.geely.design.pattern.structural.decorator.v1; /** * 加一個雞蛋的煎餅 */ public class BatterCakeWithEgg extends BatterCake{ @Override public String getDescribe() { return super.getDescribe()+" 加一個雞蛋"; } @Override public int cost() { return super.cost()+1; } }
煎餅雞蛋香腸類:spring
package com.geely.design.pattern.structural.decorator.v1; /** * 加一個火腿和一個雞蛋的煎餅 */ public class BatterCakeWithEggSausage extends BatterCakeWithEgg{ @Override public String getDescribe() { return super.getDescribe() + " 加一個火腿"; } @Override public int cost() { return super.cost() + 2; } }
測試類:sql
package com.geely.design.pattern.structural.decorator.v1; public class Test { public static void main(String [] args){ BatterCake batterCake = new BatterCake(); System.out.println(batterCake.getDescribe()+"銷售價格爲 "+batterCake.cost()); BatterCake batterCakeWithEgg = new BatterCakeWithEgg(); System.out.println(batterCakeWithEgg.getDescribe()+"銷售價格爲 "+batterCakeWithEgg.cost()); BatterCake batterCakeWithEggSausage = new BatterCakeWithEggSausage(); System.out.println(batterCakeWithEggSausage.getDescribe()+"銷售價格爲 "+batterCakeWithEggSausage.cost()); } }
打印結果:express
"C:\Program Files\Java\jdk1.7.0_79\bin\java.exe" "-javaagent:D:\java\devolopKit\idea\anZh\IntelliJ IDEA Community Edition 2018.1.4\lib\idea_rt.jar=28469:D:\java\devolopKit\idea\anZh\IntelliJ IDEA Community Edition 2018.1.4\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.7.0_79\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\jce.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\jfxrt.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\resources.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\rt.jar;F:\xiangmu3\Xin\Idea\design_pattern\target\classes;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\apache\tomcat\tomcat-servlet-api\7.0.64\tomcat-servlet-api-7.0.64.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-webmvc\4.0.3.RELEASE\spring-webmvc-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-beans\4.0.3.RELEASE\spring-beans-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-context\4.0.3.RELEASE\spring-context-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-aop\4.0.3.RELEASE\spring-aop-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\aopalliance\aopalliance\1.0\aopalliance-1.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-core\4.0.3.RELEASE\spring-core-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-expression\4.0.3.RELEASE\spring-expression-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-web\4.0.3.RELEASE\spring-web-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-oxm\4.0.3.RELEASE\spring-oxm-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-jdbc\4.0.3.RELEASE\spring-jdbc-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-tx\4.0.3.RELEASE\spring-tx-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-test\4.0.3.RELEASE\spring-test-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\aspectj\aspectjweaver\1.7.3\aspectjweaver-1.7.3.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\mybatis\mybatis-spring\1.3.0\mybatis-spring-1.3.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\mybatis\mybatis\3.4.1\mybatis-3.4.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\aspectj\aspectjrt\1.6.11\aspectjrt-1.6.11.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\codehaus\jackson\jackson-mapper-asl\1.9.12\jackson-mapper-asl-1.9.12.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\codehaus\jackson\jackson-core-asl\1.9.12\jackson-core-asl-1.9.12.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-dbcp\commons-dbcp\1.4\commons-dbcp-1.4.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-pool\commons-pool\1.5.4\commons-pool-1.5.4.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\ch\qos\logback\logback-classic\1.1.2\logback-classic-1.1.2.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\slf4j\slf4j-api\1.7.6\slf4j-api-1.7.6.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\ch\qos\logback\logback-core\1.1.2\logback-core-1.1.2.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\mysql\mysql-connector-java\5.1.6\mysql-connector-java-5.1.6.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\google\guava\guava\20.0\guava-20.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\apache\commons\commons-lang3\3.5\commons-lang3-3.5.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-collections\commons-collections\3.2.1\commons-collections-3.2.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\junit\junit\4.12\junit-4.12.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\joda-time\joda-time\2.3\joda-time-2.3.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\hashids\hashids\1.0.1\hashids-1.0.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-net\commons-net\3.1\commons-net-3.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-fileupload\commons-fileupload\1.2.2\commons-fileupload-1.2.2.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-io\commons-io\2.0.1\commons-io-2.0.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\github\pagehelper\pagehelper\4.1.0\pagehelper-4.1.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\github\miemiedev\mybatis-paginator\1.2.17\mybatis-paginator-1.2.17.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\github\jsqlparser\jsqlparser\0.9.4\jsqlparser-0.9.4.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-codec\commons-codec\1.10\commons-codec-1.10.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-configuration\commons-configuration\1.10\commons-configuration-1.10.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-lang\commons-lang\2.6\commons-lang-2.6.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-logging\commons-logging\1.1.1\commons-logging-1.1.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\google\zxing\core\2.1\core-2.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\google\code\gson\gson\2.3.1\gson-2.3.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\redis\clients\jedis\2.6.0\jedis-2.6.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\apache\commons\commons-pool2\2.0\commons-pool2-2.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\projectlombok\lombok\1.16.18\lombok-1.16.18.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\session\spring-session-data-redis\1.2.0.RELEASE\spring-session-data-redis-1.2.0.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\data\spring-data-redis\1.7.1.RELEASE\spring-data-redis-1.7.1.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\data\spring-data-keyvalue\1.1.1.RELEASE\spring-data-keyvalue-1.1.1.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\data\spring-data-commons\1.12.1.RELEASE\spring-data-commons-1.12.1.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-context-support\4.2.5.RELEASE\spring-context-support-4.2.5.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\session\spring-session\1.2.0.RELEASE\spring-session-1.2.0.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\redisson\redisson\2.9.0\redisson-2.9.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\io\netty\netty-common\4.1.8.Final\netty-common-4.1.8.Final.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\io\netty\netty-codec\4.1.8.Final\netty-codec-4.1.8.Final.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\io\netty\netty-buffer\4.1.8.Final\netty-buffer-4.1.8.Final.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\io\netty\netty-transport\4.1.8.Final\netty-transport-4.1.8.Final.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\io\netty\netty-resolver\4.1.8.Final\netty-resolver-4.1.8.Final.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\io\netty\netty-handler\4.1.8.Final\netty-handler-4.1.8.Final.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\javax\cache\cache-api\1.0.0\cache-api-1.0.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\io\projectreactor\reactor-stream\2.0.8.RELEASE\reactor-stream-2.0.8.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\io\projectreactor\reactor-core\2.0.8.RELEASE\reactor-core-2.0.8.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\reactivestreams\reactive-streams\1.0.0\reactive-streams-1.0.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\fasterxml\jackson\dataformat\jackson-dataformat-yaml\2.6.7\jackson-dataformat-yaml-2.6.7.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\yaml\snakeyaml\1.15\snakeyaml-1.15.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\fasterxml\jackson\core\jackson-core\2.6.7\jackson-core-2.6.7.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\fasterxml\jackson\core\jackson-databind\2.6.7\jackson-databind-2.6.7.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\fasterxml\jackson\dataformat\jackson-dataformat-avro\2.9.0\jackson-dataformat-avro-2.9.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\fasterxml\jackson\core\jackson-annotations\2.9.0\jackson-annotations-2.9.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\apache\avro\avro\1.8.1\avro-1.8.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\thoughtworks\paranamer\paranamer\2.7\paranamer-2.7.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\xerial\snappy\snappy-java\1.1.1.3\snappy-java-1.1.1.3.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\apache\commons\commons-compress\1.8.1\commons-compress-1.8.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\tukaani\xz\1.5\xz-1.5.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\sun\faces\jsf-api\1.2\jsf-api-1.2.jar" com.geely.design.pattern.structural.decorator.v1.Test 煎餅銷售價格爲 8 煎餅 加一個雞蛋銷售價格爲 9 煎餅 加一個雞蛋 加一個火腿銷售價格爲 11 Process finished with exit code 0
需求變動:
如今腸和蛋隨機,a 加2蛋2腸 b加1蛋2腸,。。。請用最簡單的方式實現它
要求:
所謂裝飾者模式,要有抽象的實體類和肯定的實體類,同時要有抽象的裝飾者和肯定的裝飾者。如今實體類是煎餅,裝飾者是雞蛋和香腸。
關聯:
煎餅實體類繼承煎餅抽象類,裝飾者抽象類也繼承煎餅抽象類,
如何建立煎餅實體類和裝飾者抽象類的關係呢?答案是能夠經過它們的父類組合來達到目的
實質:
自我理解,這就像是i=i+1;雞蛋裝飾類也好,香腸裝飾類也好,都是把煎餅類new一次,基礎上describe加一個描述,價格加一個固定值。
UML類圖:
抽象煎餅類:
package com.geely.design.pattern.structural.decorator.v2; /** * 作成從抽象方法,方便煎餅實體類和裝飾類繼承 * * 能夠作成接口,讓其餘類實現嗎? */ public abstract class ABatterCake { public abstract String getDescribe(); public abstract int cost(); }
實體煎餅類:
package com.geely.design.pattern.structural.decorator.v2; public class BatterCake extends ABatterCake{ @Override public String getDescribe() { return "一個煎餅"; } @Override public int cost() { return 8; } }
抽象裝飾類:
package com.geely.design.pattern.structural.decorator.v2; /** * 裝飾者一樣繼承 抽象煎餅類,這是爲了方便 ,和煎餅類交互 * * 若是不用構造器的方式,使用set的方式,是否也能達到目的呢? */ public class AbstractDecorator extends ABatterCake { /** * 定義煎餅屬性,方便注入 */ private ABatterCake aBatterCake; /** * 經過構造方法,傳入煎餅類 * @param aBatterCake2 */ public AbstractDecorator(ABatterCake aBatterCake2){ this.aBatterCake = aBatterCake2; } @Override public String getDescribe() { return aBatterCake.getDescribe(); } @Override public int cost() { return aBatterCake.cost(); } }
雞蛋裝飾類:
package com.geely.design.pattern.structural.decorator.v2; public class EggDecorator extends AbstractDecorator{ /** * 傳入 * 爲何要實現構造器,父類已經沒有無參構造器了 * @param aBatterCake2 */ public EggDecorator(ABatterCake aBatterCake2) { super(aBatterCake2); } @Override public String getDescribe() { return super.getDescribe() + " 加一個雞蛋"; } @Override public int cost() { return super.cost()+1; } }
火腿裝飾類:
package com.geely.design.pattern.structural.decorator.v2; public class SauseDecorator extends AbstractDecorator{ public SauseDecorator(ABatterCake aBatterCake2) { super(aBatterCake2); } @Override public String getDescribe() { return super.getDescribe()+" 加一個香腸"; } @Override public int cost() { return super.cost() + 2; } }
測試類:
package com.geely.design.pattern.structural.decorator.v2; public class Test { public static void main(String [] args){ ABatterCake aBatterCake; //給煎餅賦值 aBatterCake = new BatterCake(); aBatterCake = new EggDecorator(aBatterCake); aBatterCake = new EggDecorator(aBatterCake); aBatterCake = new SauseDecorator(aBatterCake); System.out.println(aBatterCake.getDescribe()+" 一共賣了"+aBatterCake.cost()); } }
打印日誌:
"C:\Program Files\Java\jdk1.7.0_79\bin\java.exe" "-javaagent:D:\java\devolopKit\idea\anZh\IntelliJ IDEA Community Edition 2018.1.4\lib\idea_rt.jar=29176:D:\java\devolopKit\idea\anZh\IntelliJ IDEA Community Edition 2018.1.4\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.7.0_79\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\jce.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\jfxrt.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\resources.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\rt.jar;F:\xiangmu3\Xin\Idea\design_pattern\target\classes;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\apache\tomcat\tomcat-servlet-api\7.0.64\tomcat-servlet-api-7.0.64.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-webmvc\4.0.3.RELEASE\spring-webmvc-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-beans\4.0.3.RELEASE\spring-beans-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-context\4.0.3.RELEASE\spring-context-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-aop\4.0.3.RELEASE\spring-aop-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\aopalliance\aopalliance\1.0\aopalliance-1.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-core\4.0.3.RELEASE\spring-core-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-expression\4.0.3.RELEASE\spring-expression-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-web\4.0.3.RELEASE\spring-web-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-oxm\4.0.3.RELEASE\spring-oxm-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-jdbc\4.0.3.RELEASE\spring-jdbc-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-tx\4.0.3.RELEASE\spring-tx-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-test\4.0.3.RELEASE\spring-test-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\aspectj\aspectjweaver\1.7.3\aspectjweaver-1.7.3.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\mybatis\mybatis-spring\1.3.0\mybatis-spring-1.3.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\mybatis\mybatis\3.4.1\mybatis-3.4.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\aspectj\aspectjrt\1.6.11\aspectjrt-1.6.11.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\codehaus\jackson\jackson-mapper-asl\1.9.12\jackson-mapper-asl-1.9.12.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\codehaus\jackson\jackson-core-asl\1.9.12\jackson-core-asl-1.9.12.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-dbcp\commons-dbcp\1.4\commons-dbcp-1.4.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-pool\commons-pool\1.5.4\commons-pool-1.5.4.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\ch\qos\logback\logback-classic\1.1.2\logback-classic-1.1.2.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\slf4j\slf4j-api\1.7.6\slf4j-api-1.7.6.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\ch\qos\logback\logback-core\1.1.2\logback-core-1.1.2.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\mysql\mysql-connector-java\5.1.6\mysql-connector-java-5.1.6.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\google\guava\guava\20.0\guava-20.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\apache\commons\commons-lang3\3.5\commons-lang3-3.5.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-collections\commons-collections\3.2.1\commons-collections-3.2.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\junit\junit\4.12\junit-4.12.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\joda-time\joda-time\2.3\joda-time-2.3.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\hashids\hashids\1.0.1\hashids-1.0.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-net\commons-net\3.1\commons-net-3.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-fileupload\commons-fileupload\1.2.2\commons-fileupload-1.2.2.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-io\commons-io\2.0.1\commons-io-2.0.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\github\pagehelper\pagehelper\4.1.0\pagehelper-4.1.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\github\miemiedev\mybatis-paginator\1.2.17\mybatis-paginator-1.2.17.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\github\jsqlparser\jsqlparser\0.9.4\jsqlparser-0.9.4.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-codec\commons-codec\1.10\commons-codec-1.10.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-configuration\commons-configuration\1.10\commons-configuration-1.10.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-lang\commons-lang\2.6\commons-lang-2.6.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-logging\commons-logging\1.1.1\commons-logging-1.1.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\google\zxing\core\2.1\core-2.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\google\code\gson\gson\2.3.1\gson-2.3.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\redis\clients\jedis\2.6.0\jedis-2.6.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\apache\commons\commons-pool2\2.0\commons-pool2-2.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\projectlombok\lombok\1.16.18\lombok-1.16.18.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\session\spring-session-data-redis\1.2.0.RELEASE\spring-session-data-redis-1.2.0.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\data\spring-data-redis\1.7.1.RELEASE\spring-data-redis-1.7.1.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\data\spring-data-keyvalue\1.1.1.RELEASE\spring-data-keyvalue-1.1.1.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\data\spring-data-commons\1.12.1.RELEASE\spring-data-commons-1.12.1.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-context-support\4.2.5.RELEASE\spring-context-support-4.2.5.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\session\spring-session\1.2.0.RELEASE\spring-session-1.2.0.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\redisson\redisson\2.9.0\redisson-2.9.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\io\netty\netty-common\4.1.8.Final\netty-common-4.1.8.Final.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\io\netty\netty-codec\4.1.8.Final\netty-codec-4.1.8.Final.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\io\netty\netty-buffer\4.1.8.Final\netty-buffer-4.1.8.Final.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\io\netty\netty-transport\4.1.8.Final\netty-transport-4.1.8.Final.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\io\netty\netty-resolver\4.1.8.Final\netty-resolver-4.1.8.Final.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\io\netty\netty-handler\4.1.8.Final\netty-handler-4.1.8.Final.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\javax\cache\cache-api\1.0.0\cache-api-1.0.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\io\projectreactor\reactor-stream\2.0.8.RELEASE\reactor-stream-2.0.8.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\io\projectreactor\reactor-core\2.0.8.RELEASE\reactor-core-2.0.8.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\reactivestreams\reactive-streams\1.0.0\reactive-streams-1.0.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\fasterxml\jackson\dataformat\jackson-dataformat-yaml\2.6.7\jackson-dataformat-yaml-2.6.7.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\yaml\snakeyaml\1.15\snakeyaml-1.15.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\fasterxml\jackson\core\jackson-core\2.6.7\jackson-core-2.6.7.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\fasterxml\jackson\core\jackson-databind\2.6.7\jackson-databind-2.6.7.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\fasterxml\jackson\dataformat\jackson-dataformat-avro\2.9.0\jackson-dataformat-avro-2.9.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\fasterxml\jackson\core\jackson-annotations\2.9.0\jackson-annotations-2.9.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\apache\avro\avro\1.8.1\avro-1.8.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\thoughtworks\paranamer\paranamer\2.7\paranamer-2.7.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\xerial\snappy\snappy-java\1.1.1.3\snappy-java-1.1.1.3.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\apache\commons\commons-compress\1.8.1\commons-compress-1.8.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\tukaani\xz\1.5\xz-1.5.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\sun\faces\jsf-api\1.2\jsf-api-1.2.jar" com.geely.design.pattern.structural.decorator.v2.Test
一個煎餅 加一個雞蛋 加一個雞蛋 加一個香腸 一共賣了12
Process finished with exit code 0