From b6bc16e5502bc0afd7448b99856083aecae044ec Mon Sep 17 00:00:00 2001 From: maxy26 Date: Wed, 27 Feb 2019 23:16:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E4=B8=8A=E4=BC=A0=E5=B7=B2=E7=BB=8F?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=9A=84=E8=AE=BE=E8=AE=A1=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E7=9A=84=E4=BE=8B=E5=AD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit subject:上传目前已经完成的6中设计模式,后面会陆续增加新的,具体计划与安排会陆续在readme中更新。 --- .idea/vcs.xml | 1 + .idea/workspace.xml | 1024 ++++++++++++++--- README.md | 29 + pom.xml | 8 + .../adapter/classes/adapter/Ps2Connector.java | 11 + .../classes/adapter/Ps2UsbAdapter.java | 17 + .../classes/adapter/PsConnectorImpl.java | 11 + .../adapter/classes/adapter/UsbConnector.java | 11 + .../classes/adapter/UsbConnectorImpl.java | 12 + .../adapter/interfaces/adapter/Adapter.java | 23 + .../adapter/interfaces/adapter/Chat.java | 17 + .../adapter/interfaces/adapter/Linux.java | 22 + .../adapter/interfaces/adapter/Port.java | 17 + .../adapter/interfaces/adapter/Tomcat.java | 13 + .../adapter/object/adapater/Ps2Connector.java | 11 + .../object/adapater/Ps2UsbAdapter.java | 25 + .../object/adapater/PsConnectorImpl.java | 11 + .../adapter/object/adapater/UsbConnector.java | 11 + .../object/adapater/UsbConnectorImpl.java | 12 + src/main/com/mxy/design/decorator/Cake.java | 15 + .../mxy/design/decorator/CakeDecorator.java | 12 + .../com/mxy/design/decorator/CakeImpl.java | 15 + src/main/com/mxy/design/decorator/Candle.java | 29 + src/main/com/mxy/design/decorator/Fruits.java | 25 + src/main/com/mxy/design/observer/MAIN.java | 27 - ...ubject.java => WeChatOfficialAccount.java} | 2 +- ...pl.java => WeChatOfficialAccountImpl.java} | 2 +- src/main/com/mxy/design/proxy/IStudent.java | 9 + .../com/mxy/design/proxy/StudentImpl.java | 13 + .../com/mxy/design/proxy/StudentProxy.java | 36 + .../proxy/dynamic/cglib/proxy/IStudent.java | 9 + .../cglib/proxy/StudentCglibProxy.java | 23 + .../dynamic/cglib/proxy/StudentImpl.java | 13 + .../proxy/dynamic/jdk/proxy/IStudent.java | 9 + .../proxy/dynamic/jdk/proxy/StudentImpl.java | 13 + .../dynamic/jdk/proxy/StudentJdkProxy.java | 26 + .../mxy/design/strategy/DiscountStrategy.java | 12 + .../strategy/NewCustomerQuoteStrategy.java | 15 + .../strategy/OldCustomerQuoteStrategy.java | 17 + .../mxy/design/strategy/StrategyContext.java | 24 + .../strategy/VipCustomerQuoteStrategy.java | 15 + .../mxy/design/template/ProcessTempLate.java | 36 + .../design/adapter/ClassesAdapterTest.java | 34 + .../design/adapter/InterfaceAdapterTest.java | 37 + .../mxy/design/adapter/ObjectAdapterTest.java | 36 + .../mxy/design/decorator/DecoratorTest.java | 30 + .../com/mxy/design/observer/ObServerTest.java | 28 + .../mxy/design/proxy/DynamicProxyTest.java | 68 ++ .../com/mxy/design/proxy/StaticProxyTest.java | 35 + .../com/mxy/design/strategy/StrategyTest.java | 20 + .../com/mxy/design/template/TempLateTest.java | 29 + .../classes/adapter/Ps2Connector.class | Bin 0 -> 175 bytes .../classes/adapter/Ps2UsbAdapter.class | Bin 0 -> 731 bytes .../classes/adapter/PsConnectorImpl.class | Bin 0 -> 646 bytes .../classes/adapter/UsbConnector.class | Bin 0 -> 175 bytes .../classes/adapter/UsbConnectorImpl.class | Bin 0 -> 648 bytes .../adapter/interfaces/adapter/Adapter.class | Bin 0 -> 573 bytes .../adapter/interfaces/adapter/Chat.class | Bin 0 -> 685 bytes .../adapter/interfaces/adapter/Linux.class | Bin 0 -> 812 bytes .../adapter/interfaces/adapter/Port.class | Bin 0 -> 179 bytes .../adapter/interfaces/adapter/Tomcat.class | Bin 0 -> 593 bytes .../object/adapater/Ps2Connector.class | Bin 0 -> 175 bytes .../object/adapater/Ps2UsbAdapter.class | Bin 0 -> 925 bytes .../object/adapater/PsConnectorImpl.class | Bin 0 -> 646 bytes .../object/adapater/UsbConnector.class | Bin 0 -> 175 bytes .../object/adapater/UsbConnectorImpl.class | Bin 0 -> 648 bytes .../com/mxy/design/decorator/Cake.class | Bin 0 -> 180 bytes .../mxy/design/decorator/CakeDecorator.class | Bin 0 -> 470 bytes .../com/mxy/design/decorator/CakeImpl.class | Bin 0 -> 526 bytes .../com/mxy/design/decorator/Candle.class | Bin 0 -> 812 bytes .../com/mxy/design/decorator/Fruits.class | Bin 0 -> 704 bytes .../com/mxy/design/observer/MAIN.class | Bin 982 -> 0 bytes .../observer/WeChatOfficialAccount.class | Bin 0 -> 286 bytes ....class => WeChatOfficialAccountImpl.class} | Bin 3149 -> 3181 bytes .../mxy/design/observer/WeChatSubject.class | Bin 270 -> 0 bytes .../com/mxy/design/proxy/IStudent.class | Bin 0 -> 156 bytes .../com/mxy/design/proxy/StudentImpl.class | Bin 0 -> 652 bytes .../com/mxy/design/proxy/StudentProxy.class | Bin 0 -> 1112 bytes .../proxy/dynamic/cglib/proxy/IStudent.class | Bin 0 -> 176 bytes .../cglib/proxy/StudentCglibProxy.class | Bin 0 -> 1412 bytes .../dynamic/cglib/proxy/StudentImpl.class | Bin 0 -> 712 bytes .../proxy/dynamic/jdk/proxy/IStudent.class | Bin 0 -> 174 bytes .../proxy/dynamic/jdk/proxy/StudentImpl.class | Bin 0 -> 706 bytes .../dynamic/jdk/proxy/StudentJdkProxy.class | Bin 0 -> 1404 bytes .../design/strategy/DiscountStrategy.class | Bin 0 -> 172 bytes .../strategy/NewCustomerQuoteStrategy.class | Bin 0 -> 837 bytes .../strategy/OldCustomerQuoteStrategy.class | Bin 0 -> 837 bytes .../mxy/design/strategy/StrategyContext.class | Bin 0 -> 652 bytes .../strategy/VipCustomerQuoteStrategy.class | Bin 0 -> 837 bytes .../mxy/design/template/ProcessTempLate.class | Bin 0 -> 928 bytes .../design/adapter/ClassesAdapterTest.class | Bin 0 -> 1020 bytes .../design/adapter/InterfaceAdapterTest.class | Bin 0 -> 1227 bytes .../design/adapter/ObjectAdapterTest.class | Bin 0 -> 1154 bytes .../mxy/design/decorator/DecoratorTest.class | Bin 0 -> 1527 bytes .../mxy/design/observer/ObServerTest.class | Bin 0 -> 1040 bytes .../mxy/design/proxy/DynamicProxyTest.class | Bin 0 -> 1961 bytes .../mxy/design/proxy/StaticProxyTest.class | Bin 0 -> 1023 bytes .../mxy/design/strategy/StrategyTest.class | Bin 0 -> 1367 bytes .../mxy/design/template/TempLateTest$1.class | Bin 0 -> 976 bytes .../mxy/design/template/TempLateTest.class | Bin 0 -> 691 bytes 100 files changed, 1831 insertions(+), 169 deletions(-) create mode 100644 README.md create mode 100644 src/main/com/mxy/design/adapter/classes/adapter/Ps2Connector.java create mode 100644 src/main/com/mxy/design/adapter/classes/adapter/Ps2UsbAdapter.java create mode 100644 src/main/com/mxy/design/adapter/classes/adapter/PsConnectorImpl.java create mode 100644 src/main/com/mxy/design/adapter/classes/adapter/UsbConnector.java create mode 100644 src/main/com/mxy/design/adapter/classes/adapter/UsbConnectorImpl.java create mode 100644 src/main/com/mxy/design/adapter/interfaces/adapter/Adapter.java create mode 100644 src/main/com/mxy/design/adapter/interfaces/adapter/Chat.java create mode 100644 src/main/com/mxy/design/adapter/interfaces/adapter/Linux.java create mode 100644 src/main/com/mxy/design/adapter/interfaces/adapter/Port.java create mode 100644 src/main/com/mxy/design/adapter/interfaces/adapter/Tomcat.java create mode 100644 src/main/com/mxy/design/adapter/object/adapater/Ps2Connector.java create mode 100644 src/main/com/mxy/design/adapter/object/adapater/Ps2UsbAdapter.java create mode 100644 src/main/com/mxy/design/adapter/object/adapater/PsConnectorImpl.java create mode 100644 src/main/com/mxy/design/adapter/object/adapater/UsbConnector.java create mode 100644 src/main/com/mxy/design/adapter/object/adapater/UsbConnectorImpl.java create mode 100644 src/main/com/mxy/design/decorator/Cake.java create mode 100644 src/main/com/mxy/design/decorator/CakeDecorator.java create mode 100644 src/main/com/mxy/design/decorator/CakeImpl.java create mode 100644 src/main/com/mxy/design/decorator/Candle.java create mode 100644 src/main/com/mxy/design/decorator/Fruits.java delete mode 100644 src/main/com/mxy/design/observer/MAIN.java rename src/main/com/mxy/design/observer/{WeChatSubject.java => WeChatOfficialAccount.java} (90%) rename src/main/com/mxy/design/observer/{WeChatSubjectImpl.java => WeChatOfficialAccountImpl.java} (94%) create mode 100644 src/main/com/mxy/design/proxy/IStudent.java create mode 100644 src/main/com/mxy/design/proxy/StudentImpl.java create mode 100644 src/main/com/mxy/design/proxy/StudentProxy.java create mode 100644 src/main/com/mxy/design/proxy/dynamic/cglib/proxy/IStudent.java create mode 100644 src/main/com/mxy/design/proxy/dynamic/cglib/proxy/StudentCglibProxy.java create mode 100644 src/main/com/mxy/design/proxy/dynamic/cglib/proxy/StudentImpl.java create mode 100644 src/main/com/mxy/design/proxy/dynamic/jdk/proxy/IStudent.java create mode 100644 src/main/com/mxy/design/proxy/dynamic/jdk/proxy/StudentImpl.java create mode 100644 src/main/com/mxy/design/proxy/dynamic/jdk/proxy/StudentJdkProxy.java create mode 100644 src/main/com/mxy/design/strategy/DiscountStrategy.java create mode 100644 src/main/com/mxy/design/strategy/NewCustomerQuoteStrategy.java create mode 100644 src/main/com/mxy/design/strategy/OldCustomerQuoteStrategy.java create mode 100644 src/main/com/mxy/design/strategy/StrategyContext.java create mode 100644 src/main/com/mxy/design/strategy/VipCustomerQuoteStrategy.java create mode 100644 src/main/com/mxy/design/template/ProcessTempLate.java create mode 100644 src/test/com/mxy/design/adapter/ClassesAdapterTest.java create mode 100644 src/test/com/mxy/design/adapter/InterfaceAdapterTest.java create mode 100644 src/test/com/mxy/design/adapter/ObjectAdapterTest.java create mode 100644 src/test/com/mxy/design/decorator/DecoratorTest.java create mode 100644 src/test/com/mxy/design/observer/ObServerTest.java create mode 100644 src/test/com/mxy/design/proxy/DynamicProxyTest.java create mode 100644 src/test/com/mxy/design/proxy/StaticProxyTest.java create mode 100644 src/test/com/mxy/design/strategy/StrategyTest.java create mode 100644 src/test/com/mxy/design/template/TempLateTest.java create mode 100644 target/classes/com/mxy/design/adapter/classes/adapter/Ps2Connector.class create mode 100644 target/classes/com/mxy/design/adapter/classes/adapter/Ps2UsbAdapter.class create mode 100644 target/classes/com/mxy/design/adapter/classes/adapter/PsConnectorImpl.class create mode 100644 target/classes/com/mxy/design/adapter/classes/adapter/UsbConnector.class create mode 100644 target/classes/com/mxy/design/adapter/classes/adapter/UsbConnectorImpl.class create mode 100644 target/classes/com/mxy/design/adapter/interfaces/adapter/Adapter.class create mode 100644 target/classes/com/mxy/design/adapter/interfaces/adapter/Chat.class create mode 100644 target/classes/com/mxy/design/adapter/interfaces/adapter/Linux.class create mode 100644 target/classes/com/mxy/design/adapter/interfaces/adapter/Port.class create mode 100644 target/classes/com/mxy/design/adapter/interfaces/adapter/Tomcat.class create mode 100644 target/classes/com/mxy/design/adapter/object/adapater/Ps2Connector.class create mode 100644 target/classes/com/mxy/design/adapter/object/adapater/Ps2UsbAdapter.class create mode 100644 target/classes/com/mxy/design/adapter/object/adapater/PsConnectorImpl.class create mode 100644 target/classes/com/mxy/design/adapter/object/adapater/UsbConnector.class create mode 100644 target/classes/com/mxy/design/adapter/object/adapater/UsbConnectorImpl.class create mode 100644 target/classes/com/mxy/design/decorator/Cake.class create mode 100644 target/classes/com/mxy/design/decorator/CakeDecorator.class create mode 100644 target/classes/com/mxy/design/decorator/CakeImpl.class create mode 100644 target/classes/com/mxy/design/decorator/Candle.class create mode 100644 target/classes/com/mxy/design/decorator/Fruits.class delete mode 100644 target/classes/com/mxy/design/observer/MAIN.class create mode 100644 target/classes/com/mxy/design/observer/WeChatOfficialAccount.class rename target/classes/com/mxy/design/observer/{WeChatSubjectImpl.class => WeChatOfficialAccountImpl.class} (66%) delete mode 100644 target/classes/com/mxy/design/observer/WeChatSubject.class create mode 100644 target/classes/com/mxy/design/proxy/IStudent.class create mode 100644 target/classes/com/mxy/design/proxy/StudentImpl.class create mode 100644 target/classes/com/mxy/design/proxy/StudentProxy.class create mode 100644 target/classes/com/mxy/design/proxy/dynamic/cglib/proxy/IStudent.class create mode 100644 target/classes/com/mxy/design/proxy/dynamic/cglib/proxy/StudentCglibProxy.class create mode 100644 target/classes/com/mxy/design/proxy/dynamic/cglib/proxy/StudentImpl.class create mode 100644 target/classes/com/mxy/design/proxy/dynamic/jdk/proxy/IStudent.class create mode 100644 target/classes/com/mxy/design/proxy/dynamic/jdk/proxy/StudentImpl.class create mode 100644 target/classes/com/mxy/design/proxy/dynamic/jdk/proxy/StudentJdkProxy.class create mode 100644 target/classes/com/mxy/design/strategy/DiscountStrategy.class create mode 100644 target/classes/com/mxy/design/strategy/NewCustomerQuoteStrategy.class create mode 100644 target/classes/com/mxy/design/strategy/OldCustomerQuoteStrategy.class create mode 100644 target/classes/com/mxy/design/strategy/StrategyContext.class create mode 100644 target/classes/com/mxy/design/strategy/VipCustomerQuoteStrategy.class create mode 100644 target/classes/com/mxy/design/template/ProcessTempLate.class create mode 100644 target/test-classes/com/mxy/design/adapter/ClassesAdapterTest.class create mode 100644 target/test-classes/com/mxy/design/adapter/InterfaceAdapterTest.class create mode 100644 target/test-classes/com/mxy/design/adapter/ObjectAdapterTest.class create mode 100644 target/test-classes/com/mxy/design/decorator/DecoratorTest.class create mode 100644 target/test-classes/com/mxy/design/observer/ObServerTest.class create mode 100644 target/test-classes/com/mxy/design/proxy/DynamicProxyTest.class create mode 100644 target/test-classes/com/mxy/design/proxy/StaticProxyTest.class create mode 100644 target/test-classes/com/mxy/design/strategy/StrategyTest.class create mode 100644 target/test-classes/com/mxy/design/template/TempLateTest$1.class create mode 100644 target/test-classes/com/mxy/design/template/TempLateTest.class diff --git a/.idea/vcs.xml b/.idea/vcs.xml index d217914..c8e70dd 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -1,6 +1,7 @@ + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index ab9e0f0..00cc6c2 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,7 +1,108 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + - + - - + + + + + - - + + + + - + + + + - + + + + @@ -45,25 +169,13 @@ - - - - - - - - - - + - - - - - - + + + @@ -72,6 +184,7 @@ @@ -79,23 +192,72 @@ List<WeChatUser> userList + TOMCAT + case1 WeChatUser weChatUser + Linux + logicTest + + @@ -117,6 +279,22 @@ + + + + + + + + + + + + + + - + - - + + + + - + + + + + + + + + + + + + + + + + + + + - + - - @@ -270,17 +539,206 @@ 1550332102563 + + + + + + + + + + + + + 1550497556468 + + + 1550497864256 + + + 1550498046807 + + + 1550498615539 + + + 1550498663917 + + + 1550498705101 + + + 1550675876004 + + + 1550762815911 + + + 1550762880374 + + + 1550762907662 + + + 1550763092270 + + + 1550763298187 + + + 1550929327841 + + + 1550929360294 + + + 1550929565432 + + + 1550931738216 + + + 1550975271892 + + + 1551017118404 + + + 1551017164486 + + + 1551107239988 + + + 1551107455450 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + @@ -290,27 +748,28 @@ - - + + - + - + - + + - + @@ -318,7 +777,7 @@ - + @@ -328,27 +787,28 @@ - - + + - + - + - + + - + @@ -362,147 +822,431 @@ + + + + + + + + + + + + + + + + - file://$PROJECT_DIR$/src/main/com/mxy/design/observer/WeChatSubjectImpl.java + file://$PROJECT_DIR$/src/main/com/mxy/design/observer/WeChatOfficialAccountImpl.java 30 - file://$PROJECT_DIR$/src/main/com/mxy/design/observer/MAIN.java - 9 + file://$PROJECT_DIR$/src/test/com/mxy/design/decorator/DecoratorTest.java + 27 + + + + file://$PROJECT_DIR$/src/test/com/mxy/design/proxy/DynamicProxyTest.java + 42 + + + + file://$PROJECT_DIR$/src/main/com/mxy/design/proxy/dynamic/jdk/proxy/StudentJdkProxy.java + 18 + + + + jar://E:/Java/Java1.8/src.zip!/java/lang/reflect/Proxy.java + 709 - - - jar://E:/Java/Java1.8/src.zip!/java/io/PrintStream.java - 804 + + file://$PROJECT_DIR$/src/main/com/mxy/design/proxy/dynamic/jdk/proxy/StudentJdkProxy.java + 23 + + + + jar://E:/Java/Java1.8/src.zip!/java/lang/reflect/Method.java + 487 - + + + + h + JAVA + EXPRESSION + + + interfaces.length + JAVA + EXPRESSION + + + - + - - + + - + - - + + - + - - + + - - + + + + + + + + + + + + + + + - - + + - + - - + + - + - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + + + + + + + + + + + + + + + - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..dc889d5 --- /dev/null +++ b/README.md @@ -0,0 +1,29 @@ +# DesignPatterns + +1.观察者模式 - 已上传 + +2.装饰模式- 已上传 + +3.策略模式-已上传 + +4.适配器模式- 已上传 + +5.代理模式- 已上传 + +6.模板模式- 已上传 + +7.工厂模式(抽象)- 整理中 + +8.桥接模式- 整理中 + +9.门面模式- 整理中 + +10.组合模式- 整理中 + +11.状态模式- 整理中 + +12.命令模式- 整理中 + +13.解释器模式- 整理中 + + diff --git a/pom.xml b/pom.xml index 31f7351..db8e35c 100644 --- a/pom.xml +++ b/pom.xml @@ -84,6 +84,14 @@ 1.1.0.Final + + + cglib + cglib + 3.2.10 + + + diff --git a/src/main/com/mxy/design/adapter/classes/adapter/Ps2Connector.java b/src/main/com/mxy/design/adapter/classes/adapter/Ps2Connector.java new file mode 100644 index 0000000..cce86b6 --- /dev/null +++ b/src/main/com/mxy/design/adapter/classes/adapter/Ps2Connector.java @@ -0,0 +1,11 @@ +package com.mxy.design.adapter.classes.adapter; + +/** + * ps2插口 + */ +public interface Ps2Connector { + + + void ps2Description(); + +} diff --git a/src/main/com/mxy/design/adapter/classes/adapter/Ps2UsbAdapter.java b/src/main/com/mxy/design/adapter/classes/adapter/Ps2UsbAdapter.java new file mode 100644 index 0000000..a4d766c --- /dev/null +++ b/src/main/com/mxy/design/adapter/classes/adapter/Ps2UsbAdapter.java @@ -0,0 +1,17 @@ +package com.mxy.design.adapter.classes.adapter; + +/** + * 1.类适配器 + * PS2 to Usb 转换口 + */ +public class Ps2UsbAdapter extends UsbConnectorImpl implements Ps2Connector { + + /** + * 重点:继承你需要适配的类 + */ + @Override + public void ps2Description() { + System.out.println("正在进行 PS/2适配USB中...."); + usbDescription(); + } +} diff --git a/src/main/com/mxy/design/adapter/classes/adapter/PsConnectorImpl.java b/src/main/com/mxy/design/adapter/classes/adapter/PsConnectorImpl.java new file mode 100644 index 0000000..9512200 --- /dev/null +++ b/src/main/com/mxy/design/adapter/classes/adapter/PsConnectorImpl.java @@ -0,0 +1,11 @@ +package com.mxy.design.adapter.classes.adapter; + + +public class PsConnectorImpl implements Ps2Connector { + + @Override + public void ps2Description() { + + System.out.println("使用PS/2插口"); + } +} diff --git a/src/main/com/mxy/design/adapter/classes/adapter/UsbConnector.java b/src/main/com/mxy/design/adapter/classes/adapter/UsbConnector.java new file mode 100644 index 0000000..e016fc9 --- /dev/null +++ b/src/main/com/mxy/design/adapter/classes/adapter/UsbConnector.java @@ -0,0 +1,11 @@ +package com.mxy.design.adapter.classes.adapter; + +/** + * USB插口 + */ +public interface UsbConnector { + + + void usbDescription(); + +} diff --git a/src/main/com/mxy/design/adapter/classes/adapter/UsbConnectorImpl.java b/src/main/com/mxy/design/adapter/classes/adapter/UsbConnectorImpl.java new file mode 100644 index 0000000..fd983ee --- /dev/null +++ b/src/main/com/mxy/design/adapter/classes/adapter/UsbConnectorImpl.java @@ -0,0 +1,12 @@ +package com.mxy.design.adapter.classes.adapter; + +/** + * 使用USB插槽 + */ +public class UsbConnectorImpl implements UsbConnector { + + @Override + public void usbDescription() { + System.out.println("使用USB插口"); + } +} diff --git a/src/main/com/mxy/design/adapter/interfaces/adapter/Adapter.java b/src/main/com/mxy/design/adapter/interfaces/adapter/Adapter.java new file mode 100644 index 0000000..a297f59 --- /dev/null +++ b/src/main/com/mxy/design/adapter/interfaces/adapter/Adapter.java @@ -0,0 +1,23 @@ +package com.mxy.design.adapter.interfaces.adapter; + +/** + * 接口适配器:重在共享接口功能,并为继承该适配器的类提供各自所需方法 + */ +public abstract class Adapter implements Port { + + @Override + public void SSH() { + + } + + @Override + public void NET() { + + } + + @Override + public void FTP() { + + } + +} diff --git a/src/main/com/mxy/design/adapter/interfaces/adapter/Chat.java b/src/main/com/mxy/design/adapter/interfaces/adapter/Chat.java new file mode 100644 index 0000000..312a900 --- /dev/null +++ b/src/main/com/mxy/design/adapter/interfaces/adapter/Chat.java @@ -0,0 +1,17 @@ +package com.mxy.design.adapter.interfaces.adapter; +/** + * 该类只需要 NET FTP 就够了 所以继承父类并重写 + */ +public class Chat extends Adapter { + + + @Override + public void NET() { + System.out.println("Chat 开启80端口"); + } + + @Override + public void FTP() { + System.out.println("Chat 开启21端口"); + } +} diff --git a/src/main/com/mxy/design/adapter/interfaces/adapter/Linux.java b/src/main/com/mxy/design/adapter/interfaces/adapter/Linux.java new file mode 100644 index 0000000..b89d6fb --- /dev/null +++ b/src/main/com/mxy/design/adapter/interfaces/adapter/Linux.java @@ -0,0 +1,22 @@ +package com.mxy.design.adapter.interfaces.adapter; + +/** + * 该系统需要全部方法 + */ +public class Linux implements Port { + + @Override + public void SSH() { + System.out.println("Linux 开启22端口"); + } + + @Override + public void NET() { + System.out.println("Linux 开启80端口"); + } + + @Override + public void FTP() { + System.out.println("Linux 开启21端口"); + } +} diff --git a/src/main/com/mxy/design/adapter/interfaces/adapter/Port.java b/src/main/com/mxy/design/adapter/interfaces/adapter/Port.java new file mode 100644 index 0000000..1203d25 --- /dev/null +++ b/src/main/com/mxy/design/adapter/interfaces/adapter/Port.java @@ -0,0 +1,17 @@ +package com.mxy.design.adapter.interfaces.adapter; + +/** + * 各种协议端口 + */ +public interface Port { + + // 远程SSH端口22 + public void SSH(); + + // 网络端口80 + public void NET(); + + // 文件传输FTP端口21 + public void FTP(); +} + diff --git a/src/main/com/mxy/design/adapter/interfaces/adapter/Tomcat.java b/src/main/com/mxy/design/adapter/interfaces/adapter/Tomcat.java new file mode 100644 index 0000000..e9878cb --- /dev/null +++ b/src/main/com/mxy/design/adapter/interfaces/adapter/Tomcat.java @@ -0,0 +1,13 @@ +package com.mxy.design.adapter.interfaces.adapter; + +/** + * 该类只需要 NET 就够了 所以继承父类并重写 + */ +public class Tomcat extends Adapter { + + + @Override + public void NET() { + System.out.println("Tomcat 开启80端口"); + } +} diff --git a/src/main/com/mxy/design/adapter/object/adapater/Ps2Connector.java b/src/main/com/mxy/design/adapter/object/adapater/Ps2Connector.java new file mode 100644 index 0000000..e044504 --- /dev/null +++ b/src/main/com/mxy/design/adapter/object/adapater/Ps2Connector.java @@ -0,0 +1,11 @@ +package com.mxy.design.adapter.object.adapater; + +/** + * ps2插口 + */ +public interface Ps2Connector { + + + void ps2Description(); + +} diff --git a/src/main/com/mxy/design/adapter/object/adapater/Ps2UsbAdapter.java b/src/main/com/mxy/design/adapter/object/adapater/Ps2UsbAdapter.java new file mode 100644 index 0000000..de06190 --- /dev/null +++ b/src/main/com/mxy/design/adapter/object/adapater/Ps2UsbAdapter.java @@ -0,0 +1,25 @@ +package com.mxy.design.adapter.object.adapater; + +/** + * 1.对象适配器 + * PS2 to Usb 转换口 + */ +public class Ps2UsbAdapter implements Ps2Connector { + + + /** + * 重点:在适配器里面持有需要适配的对象 + */ + private UsbConnector usbConnector; + + + public Ps2UsbAdapter(UsbConnector usbConnector) { + this.usbConnector = usbConnector; + } + + @Override + public void ps2Description() { + System.out.println("正在进行 PS/2适配USB中...."); + usbConnector.usbDescription(); + } +} diff --git a/src/main/com/mxy/design/adapter/object/adapater/PsConnectorImpl.java b/src/main/com/mxy/design/adapter/object/adapater/PsConnectorImpl.java new file mode 100644 index 0000000..5464ded --- /dev/null +++ b/src/main/com/mxy/design/adapter/object/adapater/PsConnectorImpl.java @@ -0,0 +1,11 @@ +package com.mxy.design.adapter.object.adapater; + + +public class PsConnectorImpl implements Ps2Connector { + + @Override + public void ps2Description() { + + System.out.println("使用PS/2插口"); + } +} diff --git a/src/main/com/mxy/design/adapter/object/adapater/UsbConnector.java b/src/main/com/mxy/design/adapter/object/adapater/UsbConnector.java new file mode 100644 index 0000000..1307c7f --- /dev/null +++ b/src/main/com/mxy/design/adapter/object/adapater/UsbConnector.java @@ -0,0 +1,11 @@ +package com.mxy.design.adapter.object.adapater; + +/** + * USB插口 + */ +public interface UsbConnector { + + + void usbDescription(); + +} diff --git a/src/main/com/mxy/design/adapter/object/adapater/UsbConnectorImpl.java b/src/main/com/mxy/design/adapter/object/adapater/UsbConnectorImpl.java new file mode 100644 index 0000000..f8eff55 --- /dev/null +++ b/src/main/com/mxy/design/adapter/object/adapater/UsbConnectorImpl.java @@ -0,0 +1,12 @@ +package com.mxy.design.adapter.object.adapater; + +/** + * 使用USB插槽 + */ +public class UsbConnectorImpl implements UsbConnector { + + @Override + public void usbDescription() { + System.out.println("使用USB插口"); + } +} diff --git a/src/main/com/mxy/design/decorator/Cake.java b/src/main/com/mxy/design/decorator/Cake.java new file mode 100644 index 0000000..848dc7b --- /dev/null +++ b/src/main/com/mxy/design/decorator/Cake.java @@ -0,0 +1,15 @@ +package com.mxy.design.decorator; + +public interface Cake { + + /** + * 描述 + */ + String description(); + + /** + * 花费金额 + */ + double cost(); + +} diff --git a/src/main/com/mxy/design/decorator/CakeDecorator.java b/src/main/com/mxy/design/decorator/CakeDecorator.java new file mode 100644 index 0000000..906d7ce --- /dev/null +++ b/src/main/com/mxy/design/decorator/CakeDecorator.java @@ -0,0 +1,12 @@ +package com.mxy.design.decorator; + +public abstract class CakeDecorator implements Cake { + + + protected Cake cake; + + public CakeDecorator(Cake cake) { + this.cake = cake; + } + +} diff --git a/src/main/com/mxy/design/decorator/CakeImpl.java b/src/main/com/mxy/design/decorator/CakeImpl.java new file mode 100644 index 0000000..4cd4567 --- /dev/null +++ b/src/main/com/mxy/design/decorator/CakeImpl.java @@ -0,0 +1,15 @@ +package com.mxy.design.decorator; + +public class CakeImpl implements Cake { + + + @Override + public String description() { + return "蛋糕"; + } + + @Override + public double cost() { + return 10; + } +} diff --git a/src/main/com/mxy/design/decorator/Candle.java b/src/main/com/mxy/design/decorator/Candle.java new file mode 100644 index 0000000..80a5669 --- /dev/null +++ b/src/main/com/mxy/design/decorator/Candle.java @@ -0,0 +1,29 @@ +package com.mxy.design.decorator; + + +public class Candle extends CakeDecorator { + + double candleCost = 30; + + public Candle(Cake cake) { + super(cake); + } + + @Override + public String description() { + return "蜡烛"; + } + + @Override + public double cost() { + return (candleCost) + (cake.cost()); + } + + /** + * 涨价 + * @param price + */ + public void risePrice(double price) { + this.candleCost += price; + } +} diff --git a/src/main/com/mxy/design/decorator/Fruits.java b/src/main/com/mxy/design/decorator/Fruits.java new file mode 100644 index 0000000..fe5e919 --- /dev/null +++ b/src/main/com/mxy/design/decorator/Fruits.java @@ -0,0 +1,25 @@ +package com.mxy.design.decorator; + +public class Fruits extends CakeDecorator { + + double fruitsCost = 20; + + /** + * 构造为了 调用父类方法 + * + * @param cake + */ + public Fruits(Cake cake) { + super(cake); + } + + @Override + public String description() { + return "水果"; + } + + @Override + public double cost() { + return (fruitsCost) + (cake.cost()); + } +} diff --git a/src/main/com/mxy/design/observer/MAIN.java b/src/main/com/mxy/design/observer/MAIN.java deleted file mode 100644 index bede442..0000000 --- a/src/main/com/mxy/design/observer/MAIN.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.mxy.design.observer; - -/** - * 观察者模式 - */ -public class MAIN { - - public static void main(String[] args) { - - WeChatSubject subject = new WeChatSubjectImpl(); - //微信公众号关注的用户 - subject.followUser(new WeChatUser(1, "张三")); - subject.followUser(new WeChatUser(3, "李四")); - subject.followUser(new WeChatUser(2, "王五")); - //推送文章 - subject.notifyObServer("C#学习入门"); - //王五不关注了 觉得该公众号很烂 ^_^ - subject.cancelFollowUser(new WeChatUser(2,"王五")); - - //继续推送文章给其他两位 - subject.notifyObServer("spring学习入门"); - - - - } - -} diff --git a/src/main/com/mxy/design/observer/WeChatSubject.java b/src/main/com/mxy/design/observer/WeChatOfficialAccount.java similarity index 90% rename from src/main/com/mxy/design/observer/WeChatSubject.java rename to src/main/com/mxy/design/observer/WeChatOfficialAccount.java index 4f35023..3546a16 100644 --- a/src/main/com/mxy/design/observer/WeChatSubject.java +++ b/src/main/com/mxy/design/observer/WeChatOfficialAccount.java @@ -1,6 +1,6 @@ package com.mxy.design.observer; -public interface WeChatSubject { +public interface WeChatOfficialAccount { /** * 该公众号关注的用户 diff --git a/src/main/com/mxy/design/observer/WeChatSubjectImpl.java b/src/main/com/mxy/design/observer/WeChatOfficialAccountImpl.java similarity index 94% rename from src/main/com/mxy/design/observer/WeChatSubjectImpl.java rename to src/main/com/mxy/design/observer/WeChatOfficialAccountImpl.java index 536aac2..0fc34e9 100644 --- a/src/main/com/mxy/design/observer/WeChatSubjectImpl.java +++ b/src/main/com/mxy/design/observer/WeChatOfficialAccountImpl.java @@ -7,7 +7,7 @@ import java.util.List; -public class WeChatSubjectImpl implements WeChatSubject { +public class WeChatOfficialAccountImpl implements WeChatOfficialAccount { private List users = new ArrayList<>(); diff --git a/src/main/com/mxy/design/proxy/IStudent.java b/src/main/com/mxy/design/proxy/IStudent.java new file mode 100644 index 0000000..2477d73 --- /dev/null +++ b/src/main/com/mxy/design/proxy/IStudent.java @@ -0,0 +1,9 @@ +package com.mxy.design.proxy; + +public interface IStudent { + + void save(); + + void delete(); + +} diff --git a/src/main/com/mxy/design/proxy/StudentImpl.java b/src/main/com/mxy/design/proxy/StudentImpl.java new file mode 100644 index 0000000..3193002 --- /dev/null +++ b/src/main/com/mxy/design/proxy/StudentImpl.java @@ -0,0 +1,13 @@ +package com.mxy.design.proxy; + +public class StudentImpl implements IStudent { + @Override + public void save() { + System.out.println("保存ing"); + } + + @Override + public void delete() { + System.out.println("删除ing"); + } +} diff --git a/src/main/com/mxy/design/proxy/StudentProxy.java b/src/main/com/mxy/design/proxy/StudentProxy.java new file mode 100644 index 0000000..f5271c0 --- /dev/null +++ b/src/main/com/mxy/design/proxy/StudentProxy.java @@ -0,0 +1,36 @@ +package com.mxy.design.proxy; + +import java.util.Random; + +/** + * 重点类 静态代理 实现目标接口 + */ +public class StudentProxy implements IStudent { + + private IStudent student; + + public StudentProxy(IStudent iStudent) { + this.student = iStudent; + } + + @Override + public void save() { + System.out.println("==开启事务"); + student.save(); + System.out.println("==提交事务"); + } + + @Override + public void delete() { + Random random = new Random(); + //查询是否存在 + if(random.nextBoolean()){ + System.out.println("===开启事务"); + student.delete(); + System.out.println("===提交事务"); + }else{ + System.out.println("===该用户已经被删除"); + } + + } +} diff --git a/src/main/com/mxy/design/proxy/dynamic/cglib/proxy/IStudent.java b/src/main/com/mxy/design/proxy/dynamic/cglib/proxy/IStudent.java new file mode 100644 index 0000000..6ff4a41 --- /dev/null +++ b/src/main/com/mxy/design/proxy/dynamic/cglib/proxy/IStudent.java @@ -0,0 +1,9 @@ +package com.mxy.design.proxy.dynamic.cglib.proxy; + +public interface IStudent { + + void save(); + + void delete(); + +} diff --git a/src/main/com/mxy/design/proxy/dynamic/cglib/proxy/StudentCglibProxy.java b/src/main/com/mxy/design/proxy/dynamic/cglib/proxy/StudentCglibProxy.java new file mode 100644 index 0000000..77f85b6 --- /dev/null +++ b/src/main/com/mxy/design/proxy/dynamic/cglib/proxy/StudentCglibProxy.java @@ -0,0 +1,23 @@ +package com.mxy.design.proxy.dynamic.cglib.proxy; + +import net.sf.cglib.proxy.Enhancer; +import net.sf.cglib.proxy.MethodInterceptor; +import net.sf.cglib.proxy.MethodProxy; + +import java.lang.reflect.Method; + +/** + * 动态代理 实现JDK 接口 + */ +public class StudentCglibProxy implements MethodInterceptor { + + + @Override + public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable { + return methodProxy.invokeSuper(o, objects); + } + + public T getInstance(Class objClass) { + return (T)Enhancer.create(objClass.getClass(), this); + } +} diff --git a/src/main/com/mxy/design/proxy/dynamic/cglib/proxy/StudentImpl.java b/src/main/com/mxy/design/proxy/dynamic/cglib/proxy/StudentImpl.java new file mode 100644 index 0000000..dff60d9 --- /dev/null +++ b/src/main/com/mxy/design/proxy/dynamic/cglib/proxy/StudentImpl.java @@ -0,0 +1,13 @@ +package com.mxy.design.proxy.dynamic.cglib.proxy; + +public class StudentImpl implements IStudent { + @Override + public void save() { + System.out.println("保存ing"); + } + + @Override + public void delete() { + System.out.println("删除ing"); + } +} diff --git a/src/main/com/mxy/design/proxy/dynamic/jdk/proxy/IStudent.java b/src/main/com/mxy/design/proxy/dynamic/jdk/proxy/IStudent.java new file mode 100644 index 0000000..02a7667 --- /dev/null +++ b/src/main/com/mxy/design/proxy/dynamic/jdk/proxy/IStudent.java @@ -0,0 +1,9 @@ +package com.mxy.design.proxy.dynamic.jdk.proxy; + +public interface IStudent { + + void save(); + + void delete(); + +} diff --git a/src/main/com/mxy/design/proxy/dynamic/jdk/proxy/StudentImpl.java b/src/main/com/mxy/design/proxy/dynamic/jdk/proxy/StudentImpl.java new file mode 100644 index 0000000..2c7cf4e --- /dev/null +++ b/src/main/com/mxy/design/proxy/dynamic/jdk/proxy/StudentImpl.java @@ -0,0 +1,13 @@ +package com.mxy.design.proxy.dynamic.jdk.proxy; + +public class StudentImpl implements IStudent { + @Override + public void save() { + System.out.println("保存ing"); + } + + @Override + public void delete() { + System.out.println("删除ing"); + } +} diff --git a/src/main/com/mxy/design/proxy/dynamic/jdk/proxy/StudentJdkProxy.java b/src/main/com/mxy/design/proxy/dynamic/jdk/proxy/StudentJdkProxy.java new file mode 100644 index 0000000..f2d6e96 --- /dev/null +++ b/src/main/com/mxy/design/proxy/dynamic/jdk/proxy/StudentJdkProxy.java @@ -0,0 +1,26 @@ +package com.mxy.design.proxy.dynamic.jdk.proxy; + +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; + +/** + * 动态代理 实现JDK 接口 + */ +public class StudentJdkProxy implements InvocationHandler { + + private Object target; + + public StudentJdkProxy(Object object) { + this.target = object; + } + + public T getInstance() { + return (T) Proxy.newProxyInstance(target.getClass().getClassLoader(), target.getClass().getInterfaces(), this); + } + + @Override + public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { + return method.invoke(target, args); + } +} diff --git a/src/main/com/mxy/design/strategy/DiscountStrategy.java b/src/main/com/mxy/design/strategy/DiscountStrategy.java new file mode 100644 index 0000000..a34e17c --- /dev/null +++ b/src/main/com/mxy/design/strategy/DiscountStrategy.java @@ -0,0 +1,12 @@ +package com.mxy.design.strategy; + +/** + * 策略角色 + */ +public interface DiscountStrategy { + + + double calculateDiscount(double price); + + +} diff --git a/src/main/com/mxy/design/strategy/NewCustomerQuoteStrategy.java b/src/main/com/mxy/design/strategy/NewCustomerQuoteStrategy.java new file mode 100644 index 0000000..af81ccc --- /dev/null +++ b/src/main/com/mxy/design/strategy/NewCustomerQuoteStrategy.java @@ -0,0 +1,15 @@ +package com.mxy.design.strategy; + +import java.math.BigDecimal; + +/** + * 策略角色实现 新客户 + */ +public class NewCustomerQuoteStrategy implements DiscountStrategy { + + @Override + public double calculateDiscount(double price) { + System.out.println("老顾客9折"); + return new BigDecimal(price).multiply(new BigDecimal(0.9)).doubleValue(); + } +} diff --git a/src/main/com/mxy/design/strategy/OldCustomerQuoteStrategy.java b/src/main/com/mxy/design/strategy/OldCustomerQuoteStrategy.java new file mode 100644 index 0000000..768c63c --- /dev/null +++ b/src/main/com/mxy/design/strategy/OldCustomerQuoteStrategy.java @@ -0,0 +1,17 @@ +package com.mxy.design.strategy; + +import java.math.BigDecimal; + +/** + * 策略角色实现 老客户 + */ +public class OldCustomerQuoteStrategy implements DiscountStrategy { + + + + @Override + public double calculateDiscount(double price) { + System.out.println("老顾客8折"); + return new BigDecimal(price).multiply(new BigDecimal(0.8)).doubleValue(); + } +} diff --git a/src/main/com/mxy/design/strategy/StrategyContext.java b/src/main/com/mxy/design/strategy/StrategyContext.java new file mode 100644 index 0000000..63d5ccf --- /dev/null +++ b/src/main/com/mxy/design/strategy/StrategyContext.java @@ -0,0 +1,24 @@ +package com.mxy.design.strategy; + +/** + * 策略环境 重点类 + */ +public class StrategyContext { + + private DiscountStrategy discountStrategy; + + public StrategyContext(DiscountStrategy discountStrategy) { + this.discountStrategy = discountStrategy; + } + + /** + * 多态机制 + * @param price + * @return + */ + public double invoke(double price) { + return discountStrategy.calculateDiscount(price); + } + + +} diff --git a/src/main/com/mxy/design/strategy/VipCustomerQuoteStrategy.java b/src/main/com/mxy/design/strategy/VipCustomerQuoteStrategy.java new file mode 100644 index 0000000..d73742c --- /dev/null +++ b/src/main/com/mxy/design/strategy/VipCustomerQuoteStrategy.java @@ -0,0 +1,15 @@ +package com.mxy.design.strategy; + +import java.math.BigDecimal; + +/** + * 策略角色实现 vip客户 + */ +public class VipCustomerQuoteStrategy implements DiscountStrategy { + + @Override + public double calculateDiscount(double price) { + System.out.println("vip顾客5折"); + return new BigDecimal(price).multiply(new BigDecimal(0.5)).doubleValue(); + } +} diff --git a/src/main/com/mxy/design/template/ProcessTempLate.java b/src/main/com/mxy/design/template/ProcessTempLate.java new file mode 100644 index 0000000..74aed65 --- /dev/null +++ b/src/main/com/mxy/design/template/ProcessTempLate.java @@ -0,0 +1,36 @@ +package com.mxy.design.template; + +/** + * 抽象模板 + */ +public abstract class ProcessTempLate { + + /** + * 校验参数 + */ + protected void checkParam(String... arg) { + if( null == arg){ + System.out.println("参数为null"); + return; + } + } + + /** + * 主逻辑业务 + */ + protected abstract void mainLogic(); + + /** + * 执行模板 + */ + protected void invoke(String... param) { + try { + checkParam(param); + mainLogic(); + } catch (Exception e) { + e.printStackTrace(); + } + + } + +} diff --git a/src/test/com/mxy/design/adapter/ClassesAdapterTest.java b/src/test/com/mxy/design/adapter/ClassesAdapterTest.java new file mode 100644 index 0000000..06bf946 --- /dev/null +++ b/src/test/com/mxy/design/adapter/ClassesAdapterTest.java @@ -0,0 +1,34 @@ +package com.mxy.design.adapter; + +import com.mxy.design.adapter.classes.adapter.Ps2Connector; +import com.mxy.design.adapter.classes.adapter.Ps2UsbAdapter; +import com.mxy.design.adapter.classes.adapter.PsConnectorImpl; +import org.junit.Test; + +/** + * 适配器:这种模式涉及到一个单一的类,该类负责加入独立的或不兼容的接口功能 + * 适配器分为两类:类适配器模式、对象的适配器模式,接口适配器 + * 不同点: + * 1.类适配器:使用继承 + * 2.对象适配器:使用组合(建议使用组合模式 降低耦合) + * 3.继承原有方法 子类需要重写需要的 并不需要全部都是实现 + */ +public class ClassesAdapterTest { + + + /** + * 类适配器 + */ + @Test + public void logicTest() { + System.out.println("======适配前======="); + Ps2Connector ps2Connector = new PsConnectorImpl(); + ps2Connector.ps2Description(); + System.out.println("======适配后======"); + Ps2Connector adapter = new Ps2UsbAdapter(); + adapter.ps2Description(); + } + + + +} diff --git a/src/test/com/mxy/design/adapter/InterfaceAdapterTest.java b/src/test/com/mxy/design/adapter/InterfaceAdapterTest.java new file mode 100644 index 0000000..2836d06 --- /dev/null +++ b/src/test/com/mxy/design/adapter/InterfaceAdapterTest.java @@ -0,0 +1,37 @@ +package com.mxy.design.adapter; + +import com.mxy.design.adapter.interfaces.adapter.Chat; +import com.mxy.design.adapter.interfaces.adapter.Linux; +import com.mxy.design.adapter.interfaces.adapter.Port; +import com.mxy.design.adapter.interfaces.adapter.Tomcat; +import org.junit.Test; +/** + * 适配器:这种模式涉及到一个单一的类,该类负责加入独立的或不兼容的接口功能 + * 适配器分为两类:类适配器模式、对象的适配器模式,接口适配器 + * 不同点: + * 1.类适配器:使用继承 + * 2.对象适配器:使用组合(建议使用组合模式 降低耦合) + * 3.继承原有方法 子类需要重写需要的 并不需要全部都是实现 + */ +public class InterfaceAdapterTest { + + /** + * 接口适配器 + */ + @Test + public void logicTest() { + System.out.println("====LINUX使用原生的端口"); + Port linuxPort = new Linux(); + linuxPort.FTP(); + linuxPort.SSH(); + linuxPort.NET(); + System.out.println("====TOMCAT抽象并重写的端口"); + Port tomcatPort = new Tomcat(); + tomcatPort.NET(); + System.out.println("====CHAT抽象并重写的端口"); + Port ChatPort = new Chat(); + ChatPort.FTP(); + ChatPort.NET(); + } + +} diff --git a/src/test/com/mxy/design/adapter/ObjectAdapterTest.java b/src/test/com/mxy/design/adapter/ObjectAdapterTest.java new file mode 100644 index 0000000..ec5b7ed --- /dev/null +++ b/src/test/com/mxy/design/adapter/ObjectAdapterTest.java @@ -0,0 +1,36 @@ +package com.mxy.design.adapter; + +import com.mxy.design.adapter.object.adapater.Ps2Connector; +import com.mxy.design.adapter.object.adapater.Ps2UsbAdapter; +import com.mxy.design.adapter.object.adapater.PsConnectorImpl; +import com.mxy.design.adapter.object.adapater.UsbConnectorImpl; +import org.junit.Test; + +/** + * 适配器:这种模式涉及到一个单一的类,该类负责加入独立的或不兼容的接口功能 + * 适配器分为两类:类适配器模式、对象的适配器模式,接口适配器 + * 不同点: + * 1.类适配器:使用继承 + * 2.对象适配器:使用组合(建议使用组合模式 降低耦合) + * 3.继承原有方法 子类需要重写需要的 并不需要全部都是实现 + */ +public class ObjectAdapterTest { + + + /** + * 对象适配器 + */ + @Test + public void logicTest() { + + System.out.println("======适配前======="); + Ps2Connector ps2Connector = new PsConnectorImpl(); + ps2Connector.ps2Description(); + System.out.println("======适配后======"); + Ps2Connector adapter = new Ps2UsbAdapter(new UsbConnectorImpl()); + adapter.ps2Description(); + } + + + +} diff --git a/src/test/com/mxy/design/decorator/DecoratorTest.java b/src/test/com/mxy/design/decorator/DecoratorTest.java new file mode 100644 index 0000000..ceade0f --- /dev/null +++ b/src/test/com/mxy/design/decorator/DecoratorTest.java @@ -0,0 +1,30 @@ +package com.mxy.design.decorator; + +import org.junit.Test; + +/** + * 装饰模式:增加功能,不改变接口 + * 对比 + * 适配器模式:改变接口名,不改变功能 + * 对比 + * 代理模式:代理类对被代理的对象有控制权,决定其执行或者不执行。 + * 而装饰模式中,装饰类对代理对象没有控制权,只能为其增加一层装饰,以加强被装饰对象的功能。 + */ +public class DecoratorTest { + + @Test + public void logicTest() { + System.out.println("装饰前======"); + Cake cake = new CakeImpl(); + System.out.println(cake.description()+"花费:"+cake.cost()); + System.out.println("装饰后======"); + Cake addFruits = new Fruits(cake); + System.out.println("只增加"+addFruits.description()+"共花费:"+addFruits.cost()); + Cake addCandle = new Candle(cake); + System.out.println("只增加"+addCandle.description()+"共花费:"+addCandle.cost()); + //为期增加功能 向下转型 + ((Candle) addCandle).risePrice(10); + System.out.println("涨价后"+addCandle.description()+"总共花费:"+addCandle.cost()); + } + +} diff --git a/src/test/com/mxy/design/observer/ObServerTest.java b/src/test/com/mxy/design/observer/ObServerTest.java new file mode 100644 index 0000000..3e1ca39 --- /dev/null +++ b/src/test/com/mxy/design/observer/ObServerTest.java @@ -0,0 +1,28 @@ +package com.mxy.design.observer; + +import org.junit.Test; + +/** + * 观察者模式:在对象之间定义了一对多的依赖,这样一来,当一个对象改变状态,依赖它的对象会收到通知并自动更新。 + * 其实就是发布订阅模式,发布者发布信息,订阅者获取信息,订阅了就能收到信息,没订阅就收不到信息。 + */ + +public class ObServerTest { + + @Test + public void logicTest() { + WeChatOfficialAccount account = new WeChatOfficialAccountImpl(); + //微信公众号关注的用户 + account.followUser(new WeChatUser(1, "张三")); + account.followUser(new WeChatUser(3, "李四")); + account.followUser(new WeChatUser(2, "王五")); + //推送文章 + account.notifyObServer("C#学习入门"); + //王五不关注了 觉得该公众号很烂 ^_^ + account.cancelFollowUser(new WeChatUser(2, "王五")); + //继续推送文章给其他两位 + account.notifyObServer("spring学习入门"); + } + + +} diff --git a/src/test/com/mxy/design/proxy/DynamicProxyTest.java b/src/test/com/mxy/design/proxy/DynamicProxyTest.java new file mode 100644 index 0000000..5867323 --- /dev/null +++ b/src/test/com/mxy/design/proxy/DynamicProxyTest.java @@ -0,0 +1,68 @@ +package com.mxy.design.proxy; + +import com.mxy.design.proxy.dynamic.cglib.proxy.StudentCglibProxy; +import com.mxy.design.proxy.dynamic.jdk.proxy.StudentJdkProxy; +import org.junit.Test; + +import java.util.Random; + +/** + * 装饰模式:增加功能,不改变接口 + * 对比 + * 适配器模式:改变接口名,不改变功能 + * 对比 + * 代理模式:代理类对被代理的对象有控制权,决定其执行或者不执行。 + * 而装饰模式中,装饰类对代理对象没有控制权,只能为其增加一层装饰,以加强被装饰对象的功能。 + * 动态代理:原理通过反射来获得代理的实现 常用的有JDK 自带jdkProxy 与 cglib 之前hibernate使用 javassist + * 好处:当时用动态代理 一个动态代理模板就能代理多个目标类 只需要传入接口 通过反射得到实现目标类方法 + */ +public class DynamicProxyTest { + + + @Test + public void cglibProxyTest() { + System.out.println("====使用代理模式前"); + IStudent iStudent = new StudentImpl(); + iStudent.save(); + iStudent.delete(); + System.out.println(); + System.out.println("=====使用CGLIB代理模式后"); + IStudent cglibProxy = new StudentCglibProxy().getInstance(IStudent.class); + save(cglibProxy); + delete(cglibProxy); + } + + @Test + public void jdkProxyTest() { + System.out.println("====使用代理模式前"); + IStudent iStudent = new StudentImpl(); + iStudent.save(); + iStudent.delete(); + System.out.println(); + System.out.println("=====使用JDK动态代理模式后"); + IStudent jdkProxy = new StudentJdkProxy(iStudent).getInstance(); + + //与静态代理输出结果保持一致 + save(jdkProxy); + + //查询是否存在 + delete(jdkProxy); + } + + private void delete(IStudent jdkProxy) { + if (new Random().nextBoolean()) { + System.out.println("===开启事务"); + jdkProxy.delete(); + System.out.println("===提交事务"); + } else { + System.out.println("===该用户已经被删除"); + } + } + + private void save(IStudent jdkProxy) { + System.out.println("==开启事务"); + jdkProxy.save(); + System.out.println("==提交事务"); + } + +} diff --git a/src/test/com/mxy/design/proxy/StaticProxyTest.java b/src/test/com/mxy/design/proxy/StaticProxyTest.java new file mode 100644 index 0000000..2d4fd1a --- /dev/null +++ b/src/test/com/mxy/design/proxy/StaticProxyTest.java @@ -0,0 +1,35 @@ +package com.mxy.design.proxy; + +import org.junit.Test; + +/** + * 装饰模式:增加功能,不改变接口 + * 对比 + * 适配器模式:改变接口名,不改变功能 + * 对比 + * 代理模式:代理类对被代理的对象有控制权,决定其执行或者不执行。 + * 而装饰模式中,装饰类对代理对象没有控制权,只能为其增加一层装饰,以加强被装饰对象的功能。 + * + * 缺点: + * + * 1)代理类和委托类实现了相同的接口,代理类通过委托类实现了相同的方法。这样就出现了大量的代码重复。如果接口增加一个方法,除了所有实现类需要实现这个方法外,所有代理类也需要实现此方法。增加了代码维护的复杂度。 + * + * 2)代理对象只服务于一种类型的对象,如果要服务多类型的对象。势必要为每一种对象都进行代理,静态代理在程序规模稍大时就无法胜任了。如上的代码是只为UserManager类的访问提供了代理,但是如果还要为其他类如Department类提供代理的话,就需要我们再次添加代理Department的代理类。 + */ +public class StaticProxyTest { + + + @Test + public void logicTest() { + System.out.println("====使用代理模式前"); + IStudent iStudent = new StudentImpl(); + iStudent.save(); + iStudent.delete(); + System.out.println(); + System.out.println("=====使用代理模式后"); + IStudent studentProxy = new StudentProxy(iStudent); + studentProxy.save(); + studentProxy.delete(); + } + +} diff --git a/src/test/com/mxy/design/strategy/StrategyTest.java b/src/test/com/mxy/design/strategy/StrategyTest.java new file mode 100644 index 0000000..87b77f5 --- /dev/null +++ b/src/test/com/mxy/design/strategy/StrategyTest.java @@ -0,0 +1,20 @@ +package com.mxy.design.strategy; + +import org.junit.Test; + +/** + * 策略模式:定义了一系列的算法,并将每一个算法封装起来,使每个算法可以相互替代,使算法本身和使用算法的客户端分割开来,相互独立。 + * 开发中:解决相同条件的多层if...else.. + */ +public class StrategyTest { + + + @Test + public void logicTest(){ + System.out.println("======不同客户,不同的折扣!======="); + System.out.println("老顾客实际消费:"+new StrategyContext(new OldCustomerQuoteStrategy()).invoke(10)); + System.out.println("vip顾客实际消费:"+new StrategyContext(new VipCustomerQuoteStrategy()).invoke(10)); + System.out.println("新顾客实际消费:"+new StrategyContext(new NewCustomerQuoteStrategy()).invoke(10)); + } + +} diff --git a/src/test/com/mxy/design/template/TempLateTest.java b/src/test/com/mxy/design/template/TempLateTest.java new file mode 100644 index 0000000..4570fcf --- /dev/null +++ b/src/test/com/mxy/design/template/TempLateTest.java @@ -0,0 +1,29 @@ +package com.mxy.design.template; + +import org.junit.Test; + +/** + *  模板方法 一个模板方法是定义在抽象类中的,把基本操作方法组合在一起形成一个总算法或一个总行为的方法。 + * 本人倾向于使用内部构造实现 + * JDK 中的servlet 就是一个典型的模板方法 + */ +public class TempLateTest { + @Test + public void logicTest() { + + + new ProcessTempLate() { + + @Override + protected void checkParam(String... arg) { + System.out.println(arg.length); + } + + @Override + protected void mainLogic() { + System.out.println("处理主逻辑"); + } + }.invoke("参数1","参数2"); + + } +} diff --git a/target/classes/com/mxy/design/adapter/classes/adapter/Ps2Connector.class b/target/classes/com/mxy/design/adapter/classes/adapter/Ps2Connector.class new file mode 100644 index 0000000000000000000000000000000000000000..96a286ea65ced5796a95c518d130506086b63787 GIT binary patch literal 175 zcmYk0K?=e!6h!CO+NcZBTj<6>^#+Pt1;KqxLrH0ql3zuy=E4JbC^6lLn_*`0X6F5Q zz5r}677zj>!nEalXIKZ@cGf$>V6i+CCMSOl+U#v@2=gQ7Tko9Foe!%@-4tQ1eIuLu yLl%Z@>7*)D+nFGBt(Xn}@;^$L^{}j!E9K!*#lDO{Na7`c(m0N^cNj)ZkbMEAST0Zi literal 0 HcmV?d00001 diff --git a/target/classes/com/mxy/design/adapter/classes/adapter/Ps2UsbAdapter.class b/target/classes/com/mxy/design/adapter/classes/adapter/Ps2UsbAdapter.class new file mode 100644 index 0000000000000000000000000000000000000000..ce7cdad0287c4fde8cf913bdf4cc9574f384a030 GIT binary patch literal 731 zcmbVKJ#Q015PfSqzT`Nc69<#=cYC^BBhn!x zI`{?9AR3w!P$Vct==mKGC4VAfd`2cn6cJnO?7W%xc4ub4pB@|nSjB=12a{vCi25il zxtPMVi!v@dxZ>cdgKG@syDCxk9z$_)X^Ww>p*xbH+Ej^r(u>gAY?}7{L3EA5Pfg>YG-0Mv zt8~KP2D+Dp@{!7~{40HBTRayY#^5@*?%@V*GRz+Be*F3V)A6@=#~hFj-kQmI2G!+5_| z9*LyOgB@dKOyki#%TRCT5v6%6Q;7|1CPhq*ocssO;H3Sei27Pz91sVRmf-GMf82i0 zw9gEHI#s40!!SzUr$CmvP5TA%I9Wz^WO*O#a~}3+FXy0x3Z1<{0(?}-qbi2v^;`_7 jd_kdB+(T)34d=!b`)2&q!89yUd8H!C%Mgg^7oMO8J literal 0 HcmV?d00001 diff --git a/target/classes/com/mxy/design/adapter/classes/adapter/PsConnectorImpl.class b/target/classes/com/mxy/design/adapter/classes/adapter/PsConnectorImpl.class new file mode 100644 index 0000000000000000000000000000000000000000..829be4eb49c9414ca93cea3a0ba5a141fb9b2626 GIT binary patch literal 646 zcmbVJOKTHR6#j0SWSZ$T#yqTj+g;82tSLK{fQ{$_GXZk6a;ne?@;?Mif1Mzeb7be<{ZvB-}jx@@AL0J0X)Zsiz2Ee)KH&A!^I;kIC$(} z(ZLc!@wL(_*YRJB>Sb*Jv&M#Ke1H6l^n;Bini-tsko>QARVkT{Dh- z`BtS(>o*8nBXKM|%%bFA*~1D}87hB%{5t#asng}Hf2Z&No_=(&=3yOA7+&0OEYeK- z@IdGxKj@EWUWR9P)@n_6ye8B=v55@n&Sp$T8QzJNPP$1fMM(Fk-I8W-q7)R+ zc^aD&Vm2GGlpbz3d)PpMo=iacc#b?>h^$KyC(p;?P l==oFf%S;R?eL=1|^A-6^0hdZtpib@;kX@LR3Enp!7+yKPNfM8G4uPRlWR7r~9Y788JLm|=yu~_!-Y`;Ix z7l0k6Ir1D6!o2szfxU9N3)&jOXtll)W@p51r92;v`j@u~*} zLB0DOE`K4ui4qq)d3lewRTcFf-)`>#EMUq;8**9nqA!EIjeZPR7_=~CVVI$9MJgGu zGPF$3lo-{?OQo+}u8y+3IWnpAR zxxCD4v4~th;Km5ktoMz#u9XsgtfQ^47A!M#){VCzj33EbEVW{=i@F~9VpArp`QI0F zRes1FWRSHm;$ReGB=+g<;q~ldzqs~ta{7F7ZeiTP1ST04|EY_iJK=Eyt}5=1S0%v= z^Zx+*0aQFTu?Wd&T_?DFp+OB~1d5SVQMA4?orOYU|&fb7sHpcA~ljS5j6rGO+bfA+ea2vS4ibr Zu95x%uxSKh$e{fjNVW;mP16*5-T~-$pws{W literal 0 HcmV?d00001 diff --git a/target/classes/com/mxy/design/adapter/interfaces/adapter/Adapter.class b/target/classes/com/mxy/design/adapter/interfaces/adapter/Adapter.class new file mode 100644 index 0000000000000000000000000000000000000000..3470eec272b9248e2530f03e57f85751d645f84e GIT binary patch literal 573 zcmb7=&q~8U5XQev(?-*1W3><9%|FmZ>`f6wEFMBFB=o-7taVHNNRo;^mM6i358y+I z6B~+1p?djdznT5*%+AN>+dF^(dNvx^vCy@!YhjO}b*@ugUNAHc4krxeRTe3Rj;B*K znkS*k0};lQ>3W$I@kHdh@^#WI?{&d&>d7qO$5Lls{tfBqIv^beV+PyL=DAcuT{U#-oBf%16b_nbF`WFn4})9rJQnGc--a_KONRd6 zpBZO)Y3{?Itt;&^dk~)hEu+b(*|60Pw-=1>6 b!S)Z3wo-#z>p^!VxV;|itpqzXpaJ&__QYpo literal 0 HcmV?d00001 diff --git a/target/classes/com/mxy/design/adapter/interfaces/adapter/Chat.class b/target/classes/com/mxy/design/adapter/interfaces/adapter/Chat.class new file mode 100644 index 0000000000000000000000000000000000000000..b517d9b21cc62ebc16d3285fb60b7db7469d8fe1 GIT binary patch literal 685 zcmb7BOG*Pl5PhBBWX93N#Q#685*JP)fH6P)s7#8EVLKZRj=y3s_K4udwd44j%5QH(mKX49>;`%Nle8ttzkyPEJJKd zI?~@}2xoJ3hDgb63Wh{kI%2)ewn{sbfbk?b<$%MI7I?9(%= zDY~-dSiH$QzVIyRkUiuL(fx)>N8B$`xBcB3*}YnY!Kk`DuOarN>Z7ZI)nk6bO~j#V zm@_et1%|XrEcKtx`7DsMH5TN{LZcwf-J-8|K?&S{GG59?8uN*!&+_b zw5;k`*B3VJ<@S7r@$yGTx>m)bm#F%l;5O}^9so0F9aYqJh?fnBfuv7xtC*`JgBX3J zI$<#NHe?NoEV>!p(Uk|VTXI4eA{z@pnB<$E{xC);qVN4CZ&0-&>vssH!uN>$2pE(C db%>MPkBE*hk>p^J=m3!fi6jS#j8cmbQtyjJn0f#J literal 0 HcmV?d00001 diff --git a/target/classes/com/mxy/design/adapter/interfaces/adapter/Linux.class b/target/classes/com/mxy/design/adapter/interfaces/adapter/Linux.class new file mode 100644 index 0000000000000000000000000000000000000000..ec83a308f83ce213ff2c743dd8ef699538150550 GIT binary patch literal 812 zcmb7?%}(1u5Xb);LhKkrLP$#ahVspUg$SvYsJNga4iQ9hl>5fnhDEWB90$RTH-LBG z$N|v-18ByK(u{aeb3=C+PGw})Y4EZQC+xd0TxwZS;Zww>(m4_TU_u6n6T ybs3G5bDF~$Z;7sK z+d6OYjwf7Q+7!>ZA-W@|;aCRuD)e6MxWS;+ot|rm6Y0N^3dzk&e#O&JkW?_A#sU@@ z3L&*Ne7hOm4fe{P4};zI{K+gTh~2TaErFg{{k~89ly!6NmmSop`}M~yHaXm9dY_G|3pCTNK#a((kU~_ z@r@U-$AH!-CIT>l6y4Kd1LX;-7$!&J-M|b`pAgAKpAj1yXhebJNs^6C)R9Ss*a))U D`^Sw4 literal 0 HcmV?d00001 diff --git a/target/classes/com/mxy/design/adapter/object/adapater/Ps2Connector.class b/target/classes/com/mxy/design/adapter/object/adapater/Ps2Connector.class new file mode 100644 index 0000000000000000000000000000000000000000..2391546ab17d9fce12bc11ae2e0ee2e73376aa45 GIT binary patch literal 175 zcmYk0K?=e!6h!CO+NulDTiA_(>J1dP3WEEXhLX}IA*rHQbKwCzl$dnoW|)CD%zVDD zH-IgsIr1D6!rc0DFTHTe_R46&XjNPYv$MH5ArGpRgyqSXJEOG}y>aV?-#K9;Ovk#% xlU35IS~Fg8+e^pHwF%e|dCdP+!XlPg%XQ6;1DFvANw@@18pe@EhjGvZ*$fgc5Pj=}I&n=}+%%N$hR-yWYAF;{sR#*L^%OxQ)804EDr^<+Mz(|K4Iy!Z zUjP@xg-Z`0puhp{{0>0vpFoVA99+~xge9;2M)Tf`-;96!`T7mOG8QcqaIy#!b48rO z=>pDJIE!23^$s-4&31Jj@uED>?)Uccs~}QtJ~X@ zl0u%~%?xdoVd9olGQQ2QQu{B3g)N5sn(hdOsisuo-XLg;@Bwf4DB?7=&wE=ulnEXM z^YKF&G29%tTq|l&&v%BOLmij;QDa?1ekl8~)QTZjOPa7eJqUfVA=AQ#NK4!N5w~HZ zY{SB&iAy#v;|fFd_wJituiox|f4Tqq`FzWB8wXFG9z1)o>D~SLd3T8}6IX3qL(Rm3 zjXKH<%VYX{r~`)SqzAXhRoA_rPK4q5_)3{UXN0_+C>8-3pa(I-Y%?t(wc84%ioG}# zJRrYjjtDcD{UoVJ_RZFY#I!eJN!49V3>~+<>_X9WXe~3-L6sJ{0EQynM&dp#xk2wX zj?-Bpv_aUQr&Zqrt1o_p@h;7oqO*h?ozuwU1SvT522_UG6mbXJaq)pxsGEn&oXoT@` literal 0 HcmV?d00001 diff --git a/target/classes/com/mxy/design/adapter/object/adapater/PsConnectorImpl.class b/target/classes/com/mxy/design/adapter/object/adapater/PsConnectorImpl.class new file mode 100644 index 0000000000000000000000000000000000000000..7d7572c15008263dc625776790d869f97edb2531 GIT binary patch literal 646 zcmbVJOG_J36#i~rlT4>EjmFxy?o1b6h@yhhjUp668%W9iW^zfd%-lQ7+(`WuLh&EC zajOdjLEZa1)c%X&nMp|>bWyrFhwnVT?>uh4Ut9rL!Gent>J?05ri_M*Sv++x=ir%x z=M1GyrImfhkY8-}7z$fvAQ`6GO3M$UurK3Jq90JC-Zs7ndLmXS{t+zL&njV9Z~G?X z;g@|rkck>XCWWwfS{iQk7&u)$D`lGe6N{8&X+8O`8!%_#Qe zj!H#m{%Ba*6??)%85IXFJiNp!hT84r^|!<0PM5dt55C?V965OH;SJ^)R{w7-;!JgT zAoP%b%vNAn{%5Y%WXIo#y8DThA>G-GEJLH6NhrfRvC_6{V<|$q$Mj#q3{I351$3Uq z;X@LR3E$Bi9xB-Zj0l}W6QI)Dqs-#75H3kmAp%6(Y7R#2NWq-b} zH-J6nIr1Dc!gBE9sJwK#>$Nq6$)>mw78g4>sZP34g!R>ngEdCU-nwng@0_rcwq@<( x$x7vQWf(7c*DJ@Yr~@`e9`k>du!?2Ya8t4K2xbIA5-tIhhH<3PVHz|+_5F4+J8 literal 0 HcmV?d00001 diff --git a/target/classes/com/mxy/design/adapter/object/adapater/UsbConnectorImpl.class b/target/classes/com/mxy/design/adapter/object/adapater/UsbConnectorImpl.class new file mode 100644 index 0000000000000000000000000000000000000000..aa21154fb139c1ff74a097a08bb173a0e8289eaa GIT binary patch literal 648 zcmbVJ%Ps^_5IuJcJ=5B281Lr}3%wu_Ar^>4GC?xT{&vsJxYB*^r2CHW6%z3WHnuEC zB-r~7kG~MrO}t`dQ1-AJt%?6Ph|zF3#Z)Z*`s znSFl19psR=FyvquBed+}?fuK?`EGgT`S|4N_{_qngE5RV%>Q#QhR$S;8*o)~x6&gR zX8%FO&{)g7?C-yzx$(c0*v&j-D{7>K&nI?9EBF*S#X- zTX9jVI3X;h9r*Bg@}ShM2_dZ$-Z~yjg!$imJatO?lt4(rA0S~t4+eysA`OI)MUL4I DV0J2G literal 0 HcmV?d00001 diff --git a/target/classes/com/mxy/design/decorator/CakeDecorator.class b/target/classes/com/mxy/design/decorator/CakeDecorator.class new file mode 100644 index 0000000000000000000000000000000000000000..9914fb2fd3f6304e52e7d9bd5b767004eeb6ee47 GIT binary patch literal 470 zcmah_u};G<5Pg@LrU`+T0%bx72GkabENmc_qD~PEpzMwt6_+HI(zJrlVn9d?d;lMX zI2Y*H`sA~o@4e^qeSLp?0=U3|4}l#IHMCvqy4Z8EPY_BzrG%qMnLNy&U&2v3)#HK> zWlC9@G8{1Bl2E_Wg|4m%C*3vNUd*-wGh*9jq>J=+mM3ZXAd`%5+L2K*i)E=T{<{>_ zqn;Ah7~lN2#NGJ!W>%_ns285L#bxz;BIhzd1DybMxP;S{Ut8)3EvpPOS&YNGWRj|i zaJW)SsC9d>IOdrO5H@%V`zFtuI2!Oc`;3NgH~_!@4(gx1!FgrmV3YGUtHE5sY>(Li Uqs}iITU@ovU$|P&CL;%}AGcC(ivR!s literal 0 HcmV?d00001 diff --git a/target/classes/com/mxy/design/decorator/CakeImpl.class b/target/classes/com/mxy/design/decorator/CakeImpl.class new file mode 100644 index 0000000000000000000000000000000000000000..7a3f68aec1a92ea711f5d8b8f691bbe48f5a1633 GIT binary patch literal 526 zcmaiwOG*Pl5QhKGOdjT;F~%pj2)alFGaGk`2oXUTbfIM5=`^w9%yj5XM9<*bm4{Gq zA-M1WUPMnJR>v5F3++YyUDf~BRn+Up^9z72tYneGd%+kNnFIGBYC|7HKmtSx%;8DjriH(XnWO9Y>$HQUv8L}sO zV1ztSc7Ve7S9Oc!k--#A|9*S@_ISfk`F8?_;!nThR#yt@v-&573X-%sM*9LBQtC-D zOPNQ?NRt~+U=MUjAV<-ftu;?E|7Ab{)0ELpQKV?$P12#Sl(?sK63tAY&KR9VX@u6v VZBe%j=k6CNpX1x5722k=GoDa13ISgIGhFn_+8Z+>&mH~ZuFx9v63lLyFfCrxy`t|nR&)07PETLJ&R)DLxMx_PCvYrIC3NnsW z?{9GhRtpo+;v?4hsDh1x*gKq4ANvJHPf$jQ<9zqd7l>{XrO$9aa-oDe`vq>>KcWJc zhdeAYx-vb0OK33SQR|I3fy>;RV(;cLP;OK{Fl7pJxoD9V66Evp3?ghzwe6eb|O`~~rZPe_RsyjR^*E4I?Ro5~bN2aF&+%anYscH!d-HCTYH5(+hSVAz{Jv7uH$WWZ+sS97Z zjv!wwRnN>z(`cAZ-8k?)<t`ULWo$m<>rvD8@fiIQf%Lx|+agXy(ecbzr_K0IV z`^wADka8ZeCuk2e#E|9QPdA7=eh3w_!0BQ&nW3z7os?hnoAFPiKR&3G6!@dYp^k8A({ literal 0 HcmV?d00001 diff --git a/target/classes/com/mxy/design/observer/MAIN.class b/target/classes/com/mxy/design/observer/MAIN.class deleted file mode 100644 index d5e7d4366bd0b48c05e8907d94f53f24f6da49f5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 982 zcmah{T~E_s6n@@)wJQ}yk@vRTRT(DphFj4p&vvvmvuc$c%`H_;Z`<^=g?qWh z40WyOmctNNALTdoZC$fqrx&vMF{_Eg;~Q=hRuWd@;ID{Y#F&yXBAr)Xw3bidFc z(m<););z6g4nv83> zPU!bHyRE%Fy8PIE**ti~Fr1xkeR$Vw?6;o3{rUR6j2pNq(+4E7Qr+Tq{9R_47&M%3 z#1QM6xpZVvT+Q{jcxF(mo}J0Lb=S7tr=7i$>VF*Pv`p$DZRWVXwZ5}dDzra5!?@Z< z2N7e2?ii*$|7QxOFigKMe*&O7Mky+kX>>9=!|6KMr*?UaVx$cQagy$Ghk$X!DU0G1 zP7}gk{)jNO1D+fruv$kjKYNJKYDfv!5otgOpx6c?ir5Q;m1q}Gqy~nLsmB$W1Imd` yr7J4|k;VxWMVuiiX-LSB!27h_GVS!3L~_aTjx6GwrA$N-=P*H{8O~E4z~paFhWE(; diff --git a/target/classes/com/mxy/design/observer/WeChatOfficialAccount.class b/target/classes/com/mxy/design/observer/WeChatOfficialAccount.class new file mode 100644 index 0000000000000000000000000000000000000000..993f5302d47c886a0e171455fe60187e1ccdf004 GIT binary patch literal 286 zcmaKnv2MaZ5JYD&!HE+gnl$_XqzKp0rHUfCvgE=-k?78svvbyQCz-OCPanR+WyU!vL=kiiLeW{_+PUhxm2ZLHupv&YxXU_ zez`lYeZ0*H1Hp}uI=+JY#yVB3(>!Yl!s|Gxc*B|Irev9`l_^^`%IvBZGFDm=hNr`6 zQ7ECf{uIKljGG)m!u$O+H;_+t`IqLE6s|`gbbMnV=n?{S0k02d?IH9I;nB|yo(_g6 BPyPS^ literal 0 HcmV?d00001 diff --git a/target/classes/com/mxy/design/observer/WeChatSubjectImpl.class b/target/classes/com/mxy/design/observer/WeChatOfficialAccountImpl.class similarity index 66% rename from target/classes/com/mxy/design/observer/WeChatSubjectImpl.class rename to target/classes/com/mxy/design/observer/WeChatOfficialAccountImpl.class index 23e64583082c349d9d5ec49ddac4d6f6bdd4d017..cd0500997ff6a877cb83acc2f9bd627aa559be4c 100644 GIT binary patch delta 133 zcmX>r@m6AkDkGDz&*VN9IX?fiw9Mqp#2m-uXRC1_HO%sh;Y sh9FIvs4^v$t8>oy4bAv$P&X20E*o#fB*mh delta 79 zcmaDWaaLl3DkG!z*`B=IL#v+w{ON?fC$mCc)C z<{ReSAJ-dzDcUYP7cGJp8Kum5mC2Ma94&-7u*0QbTbU)XW+t@8Nv3Qq=R2OiVzcpv z&=p(@sr(2gh(PMLu}} ngu(w6pRir=?O&FBoj|DA4}q#fsKNoP);?N?YaK$v-U^yec}PjR diff --git a/target/classes/com/mxy/design/proxy/IStudent.class b/target/classes/com/mxy/design/proxy/IStudent.class new file mode 100644 index 0000000000000000000000000000000000000000..7614bb40bd838b734f65fceb496c721f04946ad7 GIT binary patch literal 156 zcmX^0Z`VEs1_l!bE_MbEb_PyH2A1N)vQ$O}W)00SMh3Q&)ST23AeSpRzqBYh)h#mz z$l>)2E-6h(%`4H%N-RrcWROkH&(+VZsMJqMEzV5O(=RB>2XbJF7#RdW%Jg#*^V0SG nld@8iOV}707#Wy=_A)Rqu>kF2U}0bY(ySmFD8mL4XJ7{ag;^sc literal 0 HcmV?d00001 diff --git a/target/classes/com/mxy/design/proxy/StudentImpl.class b/target/classes/com/mxy/design/proxy/StudentImpl.class new file mode 100644 index 0000000000000000000000000000000000000000..90fb58b665a3c88b9e2a4d4b8a196049ced9e9be GIT binary patch literal 652 zcmaix%SyvQ6o&t4YSYAMwYA>Kz9x)5Br zb)gFd7rOU3?8282PpWushR>zL6o zt7DEKwI!rb+YH)jvC5F#@f(~WQx=l%hhB{bM^4QpC0q9Ej$3sC5!GK}QXPv9!&15K zd$xDlwHv%6n$m6uJ{1)eHn>!KUfV4Zx#OG=C)MCCSCp6)KMd-8S48xYU%l%s=ftsK zz|=8sVF3jO2lzWE;D0d2^RhK?LGJ2bIy0~_x;z_HvkFT45AsQ18BmT z0L~(+U?_+f;vuwPSiw0NBS9!QEe=h=d4XS0a8bdijD(C!GA>Jyi%uzPSdN6gRL0J0 z`GrL-YZT2HOPed$4DO_B1!EHY9>;Wn58l z71ty*CX9u3`-1DtZv9W_OoYcDB}PSqaVm8c~r1XW5jj=TXrs z`UPB1&`o52{q5e%_q$8wN_k^%dwKuOhsx5cAFFE;`j1@R;fowt$m!OMc7J--$Z+YA zBijykUe}UdEII~9>a|O3Y_AR0w6)2CX*p@9VCZ?ywzYcAdYG?lP88)V_C;%rRTu0s zt(h^gx{zfoIJay&XXvcrIv=B-PrDgh2frRMdp>(F|F@x?X9uGR;vW76V`WIO_-A-N zGV#XiCF1%3$v zkO}Xb=jB6E*vMep*$)hkcw|2xQaf(9r`1t*2EeJ zyhBLj8eLs)^=`e8$S?qmNlW6m|yS`H8rU0hz!c I0S`|72C;4jy#N3J literal 0 HcmV?d00001 diff --git a/target/classes/com/mxy/design/proxy/dynamic/cglib/proxy/IStudent.class b/target/classes/com/mxy/design/proxy/dynamic/cglib/proxy/IStudent.class new file mode 100644 index 0000000000000000000000000000000000000000..81891d33b327cd84a2dd3635718f566abd76746e GIT binary patch literal 176 zcmXwzK?=e!6h!CO+Gs)W7`ibCo>ynhOu$p~M7qHM|*ynfK@U z0&qeuuo74k(m_p3SnT#ULRPV5A22VvvDbVyHo)dm__1Q=4~?1>;i$V-wvSm>Jeb`YPSIcYJu=W{&kc2Nll7@YxK+t8>kYv$^_yX4?D(wIO literal 0 HcmV?d00001 diff --git a/target/classes/com/mxy/design/proxy/dynamic/cglib/proxy/StudentCglibProxy.class b/target/classes/com/mxy/design/proxy/dynamic/cglib/proxy/StudentCglibProxy.class new file mode 100644 index 0000000000000000000000000000000000000000..2192f5c7f471b88e0814cd57558d6f4e0785fc06 GIT binary patch literal 1412 zcmbVMT~8B16g@)=+m@<)NEJ{71#LlCQPfBq9&9insbbQG2Ys4uhjw8*+w4ve{*}I< z@xdS9k22ob-ReS@n3$$JckY~f@0ok^eY8F*}9 zonfqEOIz(Qq>7~jhIG|!35FXrTZ(u6Zc}&--gL+_RdX%w9B|Lp`^cGA9ouK9)GW7a zc2CdDmhkPiG<%+_H)oP}ZOgRUj@^uWb=7YPsjAxbUZctkSz9XMS)!*H{9^5hpK#OR zvTg1+kA$VlF^?w>9dem(h3dGi^2gZG04#+v{lg1ILv&cKG#tXfTz$cz!qlB^P>5kJ zc6x~fgW(25sT0!)j2OnlECB(A#o9k8GURqobvtZV`UW;AL0hOj=_@WRl42#^qpHJw zznplh4ABaX875=&!w81LMMckg162!`!Ieg%yrYGxlek>7-EQTKO-sD-g5 z%0SnuyM5C6jjac&Ff#)VOWxdB>5vDr;BmKK+5?9 zF1xa$$AwCdS)SmETK+oDA&gC$#VU84Cby20rV2|KrOyb>JbhhKw31r%%+b!ImC-u7 z`W5U886y~{rv?Lg`srr?z%^W_9erjnK`0&kfs&2Vnwd?nt)FA$GuiR@$sm3!#6hxKFFbXV=b=TK$H!E}4o^o(W18 gLeQU*S=_|}CAvrG@H*PFNS-C~jNm?54+3lXHxNN^2LJ#7 literal 0 HcmV?d00001 diff --git a/target/classes/com/mxy/design/proxy/dynamic/cglib/proxy/StudentImpl.class b/target/classes/com/mxy/design/proxy/dynamic/cglib/proxy/StudentImpl.class new file mode 100644 index 0000000000000000000000000000000000000000..84d41bc4aae68b34e538469f0ad0d22ac51dd3e9 GIT binary patch literal 712 zcmbV}yGjE=6o&svVm7<3w`jcIwNMKeL9~e22!aq)h@_uvhB&f28#WU$Z{Qa1TT<6Z04Nv?>XOpcINft=^4N}7A+VUGLgY>3L_RqF_yx(fe8bX z2BsL2TT)5A%@AK&E-)l^f|6k9%Sk2nYkpCLN4)5flFkJ#_X<3eQQa03`dC&OHgay@ zJN{YSDT%5qE2k0$QBhaim#*WMJy~pPd0i_BrT6@bmnF9GQmkXFfl3ti0Mb90lNLNH>H&qTrMzL$<5$ukV7;HL|O)-uh%I#JIdeKJ} wE&VmTN!`(~d5>5+{(!_cz@kqPCPlvA5c3N%&>7Oz0n$wnyCWn`7BLKd0suOnY5)KL literal 0 HcmV?d00001 diff --git a/target/classes/com/mxy/design/proxy/dynamic/jdk/proxy/IStudent.class b/target/classes/com/mxy/design/proxy/dynamic/jdk/proxy/IStudent.class new file mode 100644 index 0000000000000000000000000000000000000000..74a1d48a246d99f91648473506789012fd0a2cef GIT binary patch literal 174 zcmXwzO$x#=6olv1+G;`Y7`pLoJcHoMMZtYc9;JV&v}v(dbKwCzl$e07hHr*p=KXoT z034B}SfyAK;z3P9SnT#!LSm#5=P}E>vDb1c8xNav?nWcl9V#^`0_(2j_A#@Op)4%l v`!2w2Raxcob%b-3yH4Xk6o&svLL3`I*l@q@0$TtDBO#emk%*WMdd3IgC0O!*~u8 z7A7rBS(s+Xt}Cs~219ybvCNR!jC{$EFDfl}nqfu8`=Sz%QYc2A2+AT>N!<}M=0G(V zR*PN~^6M^-L56?v?v zSjC!xbp^VD2Ml8#cdNo{F*fu+or=hQeHN+@#j%uZ350%)*DzQP8xZg^c<)q%UGk9nY;alrOKzJ@;nF?(sB+D9&bk5`$x3~V z)0p?0ye-@D*NlB94KCRa4scVwkfOs)$)AY^c8@50(wC7Z++%JCN}E*dG!kVSDw z6Dy-<)<2V+`+g1}lmCp^B}Oh0|Fav-f5X^E0(Dc2Q6Pv)QcD^N3aICN%slxrSRk|{ zeow@4`l_pvZ|xGwAk)0hl<%TKMJ@*HDz4#raD^MVNqo16FHTvO=)Fz*7?ytn40~fZ literal 0 HcmV?d00001 diff --git a/target/classes/com/mxy/design/strategy/DiscountStrategy.class b/target/classes/com/mxy/design/strategy/DiscountStrategy.class new file mode 100644 index 0000000000000000000000000000000000000000..80026b92aa9dd7cc1717a72a45d8834c5907f358 GIT binary patch literal 172 zcmZ9Gu?@m76h!Zb5Caty?2t74h7lrKicDaPWhHVPDYg+=je-Ff3gJl5(40BtObO?im+4Cs%T}O=NJ1^KuXZU>Sv0X@NQg;!?PvAdslVDJr0#NIhWdY^6GWFstQgplRHeH7Db|O8xlhN7i##!Qt2T~U?f0$lti$CQSj$_Jz zZJ~)}hGRcpy!`cM_xroIw|~5PZQ!bfYq-u(*SSu})uwY_`mXR~$OFx7S#Ypo;RaS2 zR*w24hUr{5;F0e<>~9H=9%LV;vj67&hWx|s4pSvU8cCdy#)(d@D`V$TA|pi%!9!}` z?0>=x2K6pdK}0-zkC+!kEE)Oje8kjbnshbH0wuSDAwz4Nd7vll=AOX8FvH{^&S(pI zJjiG&v^g#sn4}G)uG2ae2x$~#r^#~&8DV*O2kb-sdxmT!4^~m5vnEmkW>F`k(lJL? zlQ$?@By4;{p;jEB^cm%ir5#i>)?v_TgozQ%_motC7B&gBWR+^s;&Zv*7>kn>PT~~F KGn~#jXZ`}yFwkTG literal 0 HcmV?d00001 diff --git a/target/classes/com/mxy/design/strategy/OldCustomerQuoteStrategy.class b/target/classes/com/mxy/design/strategy/OldCustomerQuoteStrategy.class new file mode 100644 index 0000000000000000000000000000000000000000..6591b8f9d1039dcab8579c60fe6635fbe6bc1999 GIT binary patch literal 837 zcmb7COKuZE5Pj|6IFo@SjtSoY=9h5*cL*$yj6fnIRu%ynS<13KZaE#zCz|O&cn4cf z0PNrZAXqpONI3xa0Fg@|swd8Zh%A^zy{?*iudA!-`|q#20Pf(n4F_kZa1M)AoVRfS z7cDewlyRx@VDGK@-Wl(*F;^^HwQ$YC5<}&lij=<3P;{F;hSFL*kPI^&70Jh0*q6yO z(GMt6>%_hYdLmKAp9D*KQ>6^69X}3v_+rEdGF8Kfr#cZ@4o7@F7_4QfjzgI|&0;OP zlOJt{Ig<0Ufbu+*`f(O%y504f9z%IMQ9j+t=xlf6Eb-+dWr|olO0Tsgo(l)ZF=N4X z(8Mysv0pD=?Y-aq@$tjmpReCoxbENvZZgzOE)Rv?` zLD3>%;|mJ4;uxiGC~qw7pklBNi%w%qjbVSHqymhvO$fTbN);IKh1_pU#7PP#af;*_ JPUoC6e*nhT&k+Cs literal 0 HcmV?d00001 diff --git a/target/classes/com/mxy/design/strategy/StrategyContext.class b/target/classes/com/mxy/design/strategy/StrategyContext.class new file mode 100644 index 0000000000000000000000000000000000000000..b92da85b44e460f0f2fc7edb450bb8c4532086d1 GIT binary patch literal 652 zcma)3%TB^j5Iwgo6xu2e5#J`RC^g!RJB=`Q6zVrfku1is3cXpAoW06)q& z7r_`365C`tbI+M`r)NID-ai1G;ZQ>cn|Uax>e#}ziX9cZ48=Z=-7pQ3P7*nZH<&V5 zZ8sd*qsi3ndodpbc07md<`VauA$!3Co?J4VnE!99cNvsM*!LI;Z60{n>8R&Lw@%Ne zlX5$B9lz^DT-5VJCAs4%{V&6b;trC1)cZ? zy+HMcjWt5Wqs>&wA{0=ZYhF>G=+v!eNVPY}G9IavNCre_6f1wk^j|R@C6ozg*qHGv E-w*GXIsgCw literal 0 HcmV?d00001 diff --git a/target/classes/com/mxy/design/strategy/VipCustomerQuoteStrategy.class b/target/classes/com/mxy/design/strategy/VipCustomerQuoteStrategy.class new file mode 100644 index 0000000000000000000000000000000000000000..4b2115580660ee3eec8314477c82ccf37f33eae0 GIT binary patch literal 837 zcmb7COKuZE5Pcng#&HIcI3|1pm|yGwo)BPV1QM}WSpj5ZDa-M=<#aS3Yo;f{SKtI} z;Q%05I1)%X0HHgM@5 zVF8Q13$-7TS3e|X1(Bt~VJjOko6Jd`Js9}y9$gXqIW{4aG?E*cAD2Ro%eTYxl??u{T7A&E{vmr78OQ;fAI+ke-d7IH3 zvGy4=mD~jRuPAJYf$9 z09(o;pf30Tz61CS#2GhATf~Be=gxhdd+zak|9$oiz!N;SU}3g`In0-_VBrq#TBzWj zKJJ@Xv|yrcV#&m^K;R&rc#ZIy!duf{tp&ZWcuCP-cO1@&W=&uV{{(j)MHf1U!fre#a_}>KDSZvVbUU9!EgK$ z_KPDwXlE*kNnxn1r&9>BX(Zj$4_+$0;@Dqo*EBU7*I=7iv9XE=9RBm&+h6ZL{rGwo zcf-)cnhh5ZZ8#XUaRW9X-Dnq>TFiy~kyi*JthW-z9PH=ND?U+qP#+>Dq9{KiA`iSzzY7gbp zoMD9>W`FP`HvpzMc$$mPF*8E~v)o`ICosplD#_i#WKP8yP;qd3K*dDCGclzVnUMMVx31=khS7&3Q-6u~`)WUby|NVVJ^XP7mFKg z3JluN-)Ol~aw~8>hTGE&S+SvG!@DPFWKtPBWGFu!$v`-~BYZ(|?nvndW*}TiVHOP6 z>+6FN<*SclQQPjwv-krMrnoQ}?)t!dX=*rwyn?!hRWumpx1)9R`pwb1gJ16tVsTqR zQ^Ok88SYG}#$*!5sXugvwgO$l4dfY0r#yW85Q_|(|802Vncp2(ouNL3HkmHfC`?$l zP1)C@ESgspu>qL}=G)OVzxA0lHkzCvLL(QJg~2vr|7BlNG6 zDik80M;2uiZ~^mJL=_dR&`)jBEp)yVI~Y4J&`XK*80jcjpj(3YakynV8CeN4T>JyT C6$LE- literal 0 HcmV?d00001 diff --git a/target/test-classes/com/mxy/design/adapter/InterfaceAdapterTest.class b/target/test-classes/com/mxy/design/adapter/InterfaceAdapterTest.class new file mode 100644 index 0000000000000000000000000000000000000000..6ec740721268ff4f08829a73bd5e88acbebd12a9 GIT binary patch literal 1227 zcmb7EOHUI~6#i~om@*WoR6s;|)EAV;AS$AOv1uTXltS!4bUBottk3FsFv5X7K_AsO|E2BAn8meGi)gv$~}7-}cD$(>sa{@%VN zhCsqv(HWYO+|*O9v8>ywwwxnNbJEIaxh2i!;#@HXoK>D@7))j?Loqfsl@&eDv!IV;OE;vn|ibT<|(oA$#;>F@)c{Gqg9kd*9LMn-eW z{9t1BVB3DjH63o~OFYjh-?(X7j^=R7q;$hc%g!omF4e76GLqAlYiIOnE=p~$miEw^ z_CO1v84(FrLi7TzF?3GSlblU0-u<@!xwQ4B_-wnhwOxAou=Ms_@%d{Bqaj?!7=v;| zf2!0)jdwRB+z8<&A|Z?mm_URfDuSu=bBVb6{mK51oma)e?$5_hi;rF$2BZ!iKalD* zj-gxVCT9MnI&^$h@dga9L@x@lxS1Un^Zp;Dm1oR9tu9b9>GTX?YDz^9 z!t^DI#|QdM5FtECCxuoI8+W)uw+ zqzyqzAWY#~aT;gPfhb`NXEB0KjG+s+(Ty3ZG(|Tm{c=R|v2ucyEkHl|uNO`EPJX%%XP(jo{^i>ZNLZjvQV$j*e_jo3R8 zyiln4Dtckif)C((c+r;-&+Z0Ih=I()?3^>_JLfw;yFY(_{{f(cZ51;}$8imr7*Nq1$Q4ZgtKc^hRD8bm<+RJF3hK0 zt7h6qMy*YnWLegYcGa-CC-;>R_a%22a^2q literal 0 HcmV?d00001 diff --git a/target/test-classes/com/mxy/design/decorator/DecoratorTest.class b/target/test-classes/com/mxy/design/decorator/DecoratorTest.class new file mode 100644 index 0000000000000000000000000000000000000000..977236a11770a383ce132b6d65ea02a1fb24006c GIT binary patch literal 1527 zcmaJ>OHUI~7(KTXW;zT4rT7*FQ43hc_X|Z{B4`B^L|G2gNxj(4G}Eckg^3#%n)q0{ zGDc&fu0%}bm;lEGI3cV_A*q3JEj@@gLcehsE=~X9LpqUO=n7#YMk+ji(vHQNvDZ$(y&dn3?8riw47Xbk}yYp+B=JGwt>;1QK?f8v;-)L%&X* zw^wEll7S%UvDmPa;V#7z^FiH;iJUfF%2+N>n$tYZDXD(TvR&QfwncUgQQL`Ya~Ud5 zE5=qP?TllX!@N+>ip;v_^c%X0ZD^5jR>cTLNrUAVcYnToo4@zqRG~>Yr{X-K46PN* z6$y_fQwfF*!lRbZt++PnI^2p6WOyQGIub6Z7{j=V30!25mhaCme^@-B;u0ps+LVgR z7%xSC{LqU|I#rD7X(Q679Sr0jy~#g+n!o>yLCN2pF9!G@-_ujY6quoN3T*mn}`+O1ox~j+~vLAI;H%F}Jk|(#a*YOg%}v z-n7Ot36>H@35$4Pk65O0k2u2HDkdp*hoP1Zsp0UHI4BIEaK~ylbS?B$%Cuq(k+q_% zViY%*vi2LcINNlah8VVnhgN$p*~+f%oehSz|J)C{(^iG~e zGra@r;bH@BV(VVefCp#)?e< literal 0 HcmV?d00001 diff --git a/target/test-classes/com/mxy/design/observer/ObServerTest.class b/target/test-classes/com/mxy/design/observer/ObServerTest.class new file mode 100644 index 0000000000000000000000000000000000000000..70533a6d46ae57eb06bf35bd8845a29fd602ac24 GIT binary patch literal 1040 zcmah{OHUI~6#nke$1sf0j)LNwhtL*bMA_AtkQx$_i6jDTaG{wFx8;)Q44Ijt`~Vlm zgq4X4V!}q_#u!%!7=M7jgKGQ}#&cT`OsLM{Jic?zJ>NNJzWv(!3SbIT8hUUwiEA1Z zsjsUT&=A957ltsb;)aS56{FJ2NRd^MOJXdEn+%D&!V}RwhK@|O$Pg>|%bcOd5*~k0 zua$YQV3%D&49j zapTMO!RHsU&3F<;?7d>>E(|q3ygS(4Zajbc^Ywcjlen$p zj!ZVfwLo~)lVOJ8cFj*tNDGlOny&3t=^U%vp^f)tX02m%K9Xt-tIozH3(**2rG(ipL$ktm4=tUoS4Ckp>X%>G(oGjqUK9r>$bXa5ih%Lp8_zn`g zNGd2bfrO#{4aAMkW5CdM(RGx16wxJMoM}alX$?Z9cHJaX=qDOEqLC+(_lepfF5oet el5$^*)*)pTC5rVE^@|jfqg^7+aG9inE589l4Gwky literal 0 HcmV?d00001 diff --git a/target/test-classes/com/mxy/design/proxy/DynamicProxyTest.class b/target/test-classes/com/mxy/design/proxy/DynamicProxyTest.class new file mode 100644 index 0000000000000000000000000000000000000000..08a57b82c0fa17108aa3b28fc194bb8d5c1183f2 GIT binary patch literal 1961 zcma)-T~iZR7{~t`kX@62GziFx8n8eB>-Hr@c@c#~Ef|y%#A4fvCD}Q(0A43Yxx^WJ}GDh4ugrEoY7!|{q5T92tF5`k59t34v6!U}|$1y2}kbW~B{akmNn@!jk)Rk+I~&(cTf)ieR;HW{)ONqpme4krHEkoMFBlnvL=&cI z*_v%wCV?6wRyv_BXBnC5c=j&GZ&&&)Et!G1p44rI*d6!}0+FElsIA3r&uA;96lAnJ z)OAO#Y&xc2HbkzP4@Q1wS-YcoaT0zRA9^u|DEZIxxAW`od*5vAY=6JE{`v04-htnXGh(;_Ka(h|I%Y#xB2$z5Y_ESUVWg_fc(GP$ zA;V7n96zCQ$s`=Fs$43O7dP>dKvD&gD&bTG&2;!`{^7>%z5A~b4OKN-B4VNT^GrL1 z6!}~fE^o2mBEf3bHj?U`X2z|Q7a!vj_AvqSFYe{npY3dYnSc1WDA`?G-`RRnl5}v- z%V$5Z4!aL>`P}op?X{QR{gi+3?O%_cuwxGzpkTj#PgVSbEl^@iYGy*czO<~z*z!f} zf+)J0vGo*>p_S!_=13tR!%}C{hG|Fbw63Li0-CCbCCDpcQ_`efpr}|hX;YjS6f_X=^T!Tq4AaT0k~=O z7!+Jl2pKmT|6+;^2Ea7xH zfFG$T0to-V0NyAB;9DHbp=lFG|DC^w{JrGwBY%MO{p26uGl*fH$#EXe5Z=py%h#^&OzZljrLZP`TYBXo*jjuEw-e_tC{PvH?C+W9I{T~nxY zJ1Y$)tR6%BYdXtBpCj}LU5pjbT8ic!G|?^sNW$CHs)egp=6BvQ4$e&nr&T!WC=##_ m#H!PATWl{MmBAV+xQGT!Fhi3S?pn+4S{-*1GbLK{y?+4xOXp<( literal 0 HcmV?d00001 diff --git a/target/test-classes/com/mxy/design/proxy/StaticProxyTest.class b/target/test-classes/com/mxy/design/proxy/StaticProxyTest.class new file mode 100644 index 0000000000000000000000000000000000000000..26bad31791a33b79fc8aa6cdcd5a2398ea1c670d GIT binary patch literal 1023 zcmah|TTc^F5dKbEy6v(^<)U1qv=y-zWD)QdykJaBNU9P`n((-6PwHv*((G=D`~edm zR37{T>I<*>08zZW`#V7Xg>lZd#!HIsN#>lH^UcgRb7sGO|L_^WBCe`9fpij+$Rv1&@T!FkLoXTelx?={4?)x}!Hemy}9i1j1aE=QZvJ zOAJZNtqW5s3<*&QS~c#_ak9JrN(VrWn%~BT!5Bs#wwyrNyefP_Y;HS_D|5LHkx7+Z zudX**RF&RIt5)2WXY#v37Bch~t=WdLX=vz2O2MoK9di`_27L#gz8t;WIoN-5wEg7U z&a1=B5yxu$o?y0Sh=Km zg<65G-7M)e}xo2|RAt)cC)`L<)2g}j7QUy^e)(Us!Q7o|D#jZJ!tc#T^;phGVIpBX4rkwqU3y8I%b z5k-pRNz!!M8SOpAJ+Qao^#I9uXdJ{KowYUqLl`EF;S@PXLg&|r(gK#>AuwAcoOYfmDkW4Vp-7b<6p@xXw_0k@+dov+~Btd@VEkdPuBS>JBvW!u#ah#!*!vu;* tV}X9uYslah6(qT3+W9-&QkcVO@@9nVqX;9!bBs{3nsM40MUoAe_yI%F0`33+ literal 0 HcmV?d00001 diff --git a/target/test-classes/com/mxy/design/strategy/StrategyTest.class b/target/test-classes/com/mxy/design/strategy/StrategyTest.class new file mode 100644 index 0000000000000000000000000000000000000000..6852463295881eac9656ecf22500701c79eb60d7 GIT binary patch literal 1367 zcmb7ETTc@~6#j-ww_U41xeMO06ciQ}uLT5(s7V7VgoHPjc2Wo1-KO0lyh)-78c2LH z%7cmePSluIh45l`~%~ewm=OO<2=lnbM`ymIp6Hb{P_KC6+kC$tEh+Dfo6E@ zXi?FMGYZbCD23aOHfh@xXbL)1sBo)r;GC_uiBf4v@4SRukXxr67ZqGmQ7Ka|E4ZSf z25tpc6;6Nk~D!0SX8x*6KLGwbJ< zg|!#+YfJCabE(ah`K6C$6KHp;nSz}`Ft}Hsyhkl0Uf8Bx4G%P+%$~y`nhr>Z%B5s)x z9=n?`Exx5vit{-!fE%*bpc6N7iyE2|(LEd5r^1+s?pcA@(l0;!FWV4*RDi9iki;!X z*%>I`x$WVJNgklf$qS9l#4R47$utx6q1vAT3sbv8|HUFAu19F5D)$I8C{YOt8zW&p^unLnE1e z=f$~Kx!s$O5 CzKh!c literal 0 HcmV?d00001 diff --git a/target/test-classes/com/mxy/design/template/TempLateTest$1.class b/target/test-classes/com/mxy/design/template/TempLateTest$1.class new file mode 100644 index 0000000000000000000000000000000000000000..e826b158840ba9e208a22d4f85b4a706bec1b359 GIT binary patch literal 976 zcma)4+iuf95IviOxONRqlct1gxrEk9pe7O$4@H$w1yUu0A~os@Pg`f@EcjB{4x(>7 zR6N5!@B<)G5S8))dsMbt9sYcI_+$7+h1D>onMJ+LuyPWx6GyH{lA|&i>L($OAZonSx3790 z+ocKB_L5YPmicHvpz2sp8QC2YGbKp{4@maPDB<5QgSM+cen_{#+Ehwbt>flFS5%|B z3b0a1DMnVF-dUJnI8D|%aU5)6@ gjp$T21kC926jeQ(#|7F8xQI)bC(9s|Mms&f0m}B^eE@mDDLV5!B7jN5+5hYNThu}iYZeMbjafY zPo<4-lST7Y630dm>cmfuPy7Rs$w>J|Bu6nf!taw4kkc2L*0;l#z)T z$V?LB2c@*(MruWb3xQ4}e>@>&M3IkrJv~W7u_vvV#fQ9a#(c`Fc!Vk`nMFu@%XYt_ zYwV;Sa~1hLlS&maxWB%g{ysb3y7RWHc#SoN_AJc*P<|SXMM#TwJF`8Heg3jkQ+-Gq zHacH||JChu2c)G!Uu=&9W_Kq0m?EE$5tcTuz%KIgJlS%d^iU(;wo(HYut-QhN*N~~ z4k&ADts6K)A}Ex;qc|+oOTA&SUhZAOy=R<9fjVnwpoJz@A27FWnU|<;?_DNzu#(#b LJVKAM4k4Yt=^UTz literal 0 HcmV?d00001