├── .gitignore ├── pom.xml └── src └── main └── java └── com └── hollischuang └── pattern ├── AbstractFactory ├── BenzBusinessCar.java ├── BenzCar.java ├── BenzSportCar.java ├── TeslaBusinessCar.java ├── TeslaCar.java ├── TeslaSportCar.java ├── client │ └── Main.java └── factory │ ├── BusinessCarFactory.java │ ├── CarFactory.java │ └── SportCarFactory.java ├── Adapter ├── Adapter.java ├── AndroidCharger.java ├── AppleCharger.java ├── GalaxyS7.java ├── Iphone6Plus.java ├── LightningInterface.java ├── Main.java └── MicroUsbInterface.java ├── Builder ├── Builder.java ├── CommonRoleBuilder.java ├── Director.java ├── Main.java ├── Role.java └── SuperRoleBuilder.java ├── FactoryMethod ├── Operation.java ├── OperationAdd.java ├── OperationDiv.java ├── OperationMul.java ├── OperationSub.java ├── client │ └── Main.java └── factory │ ├── AddFactory.java │ ├── DivFactory.java │ ├── IFactory.java │ ├── MulFactory.java │ └── SubFactory.java ├── Iterator ├── ChineseFoodMenu.java ├── Iterator.java ├── Main.java ├── Menu.java └── MenuIterator.java ├── Singlenton ├── Enum │ └── Singleton.java ├── Serializable │ └── Singleton.java ├── client │ └── SingletonClient.java ├── double_check │ ├── FinalSingleton.java │ ├── Singleton.java │ └── VolatileSingleton.java ├── hangry │ ├── Singleton.java │ └── Singleton2.java └── lazy │ ├── Singleton.java │ ├── StaticInnerClassSingleton.java │ └── SynchronizedSingleton.java ├── StaticFactory └── Main.java ├── Strategy ├── AdvancedMember.java ├── BookStore.java ├── Cashier.java ├── IntermediateMember.java ├── Member.java └── PrimaryMember.java └── staticfactory ├── Operation.java ├── OperationAdd.java ├── OperationDiv.java ├── OperationFactory.java ├── OperationMul.java └── OperationSub.java /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/.gitignore -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/pom.xml -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/AbstractFactory/BenzBusinessCar.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/AbstractFactory/BenzBusinessCar.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/AbstractFactory/BenzCar.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/AbstractFactory/BenzCar.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/AbstractFactory/BenzSportCar.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/AbstractFactory/BenzSportCar.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/AbstractFactory/TeslaBusinessCar.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/AbstractFactory/TeslaBusinessCar.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/AbstractFactory/TeslaCar.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/AbstractFactory/TeslaCar.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/AbstractFactory/TeslaSportCar.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/AbstractFactory/TeslaSportCar.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/AbstractFactory/client/Main.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/AbstractFactory/client/Main.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/AbstractFactory/factory/BusinessCarFactory.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/AbstractFactory/factory/BusinessCarFactory.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/AbstractFactory/factory/CarFactory.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/AbstractFactory/factory/CarFactory.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/AbstractFactory/factory/SportCarFactory.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/AbstractFactory/factory/SportCarFactory.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Adapter/Adapter.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Adapter/Adapter.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Adapter/AndroidCharger.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Adapter/AndroidCharger.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Adapter/AppleCharger.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Adapter/AppleCharger.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Adapter/GalaxyS7.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Adapter/GalaxyS7.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Adapter/Iphone6Plus.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Adapter/Iphone6Plus.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Adapter/LightningInterface.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Adapter/LightningInterface.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Adapter/Main.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Adapter/Main.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Adapter/MicroUsbInterface.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Adapter/MicroUsbInterface.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Builder/Builder.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Builder/Builder.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Builder/CommonRoleBuilder.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Builder/CommonRoleBuilder.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Builder/Director.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Builder/Director.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Builder/Main.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Builder/Main.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Builder/Role.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Builder/Role.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Builder/SuperRoleBuilder.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Builder/SuperRoleBuilder.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/FactoryMethod/Operation.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/FactoryMethod/Operation.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/FactoryMethod/OperationAdd.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/FactoryMethod/OperationAdd.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/FactoryMethod/OperationDiv.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/FactoryMethod/OperationDiv.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/FactoryMethod/OperationMul.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/FactoryMethod/OperationMul.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/FactoryMethod/OperationSub.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/FactoryMethod/OperationSub.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/FactoryMethod/client/Main.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/FactoryMethod/client/Main.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/FactoryMethod/factory/AddFactory.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/FactoryMethod/factory/AddFactory.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/FactoryMethod/factory/DivFactory.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/FactoryMethod/factory/DivFactory.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/FactoryMethod/factory/IFactory.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/FactoryMethod/factory/IFactory.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/FactoryMethod/factory/MulFactory.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/FactoryMethod/factory/MulFactory.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/FactoryMethod/factory/SubFactory.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/FactoryMethod/factory/SubFactory.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Iterator/ChineseFoodMenu.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Iterator/ChineseFoodMenu.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Iterator/Iterator.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Iterator/Iterator.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Iterator/Main.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Iterator/Main.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Iterator/Menu.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Iterator/Menu.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Iterator/MenuIterator.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Iterator/MenuIterator.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Singlenton/Enum/Singleton.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Singlenton/Enum/Singleton.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Singlenton/Serializable/Singleton.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Singlenton/Serializable/Singleton.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Singlenton/client/SingletonClient.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Singlenton/client/SingletonClient.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Singlenton/double_check/FinalSingleton.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Singlenton/double_check/FinalSingleton.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Singlenton/double_check/Singleton.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Singlenton/double_check/Singleton.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Singlenton/double_check/VolatileSingleton.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Singlenton/double_check/VolatileSingleton.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Singlenton/hangry/Singleton.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Singlenton/hangry/Singleton.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Singlenton/hangry/Singleton2.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Singlenton/hangry/Singleton2.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Singlenton/lazy/Singleton.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Singlenton/lazy/Singleton.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Singlenton/lazy/StaticInnerClassSingleton.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Singlenton/lazy/StaticInnerClassSingleton.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Singlenton/lazy/SynchronizedSingleton.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Singlenton/lazy/SynchronizedSingleton.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/StaticFactory/Main.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/StaticFactory/Main.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Strategy/AdvancedMember.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Strategy/AdvancedMember.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Strategy/BookStore.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Strategy/BookStore.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Strategy/Cashier.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Strategy/Cashier.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Strategy/IntermediateMember.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Strategy/IntermediateMember.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Strategy/Member.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Strategy/Member.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/Strategy/PrimaryMember.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/Strategy/PrimaryMember.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/staticfactory/Operation.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/staticfactory/Operation.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/staticfactory/OperationAdd.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/staticfactory/OperationAdd.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/staticfactory/OperationDiv.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/staticfactory/OperationDiv.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/staticfactory/OperationFactory.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/staticfactory/OperationFactory.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/staticfactory/OperationMul.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/staticfactory/OperationMul.java -------------------------------------------------------------------------------- /src/main/java/com/hollischuang/pattern/staticfactory/OperationSub.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hollischuang/DesignPattern/HEAD/src/main/java/com/hollischuang/pattern/staticfactory/OperationSub.java --------------------------------------------------------------------------------