Java常用设计模式例子

上传者: pjymyself | 上传时间: 2022-11-10 12:48:43 | 文件大小: 47KB | 文件类型: ZIP
以JAVA为例,汇总了十几种常用的设计模式,包括了:单例模式、工厂模式、建造者模式、适配器模式、装饰器模式、外观模式、命令模式、观察者模式、状态模式、策略模式、模板方法模式等。仅供学习使用。 相关文章请看【设计模式】专栏:https://blog.csdn.net/pjymyself/category_11536665.html

文件下载

资源详情

[{"title":"( 84 个子文件 47KB ) Java常用设计模式例子","children":[{"title":"DesignPattern","children":[{"title":"src","children":[{"title":"StrategyPattern","children":[{"title":"AliPay.java <span style='color:#111;'> 286B </span>","children":null,"spread":false},{"title":"ApplePay.java <span style='color:#111;'> 282B </span>","children":null,"spread":false},{"title":"Pay.java <span style='color:#111;'> 236B </span>","children":null,"spread":false},{"title":"WechatPay.java <span style='color:#111;'> 283B </span>","children":null,"spread":false},{"title":"PayStrategy.java <span style='color:#111;'> 329B </span>","children":null,"spread":false},{"title":"StrategyPatternDemo.java <span style='color:#111;'> 331B </span>","children":null,"spread":false}],"spread":true},{"title":"SingletonPattern","children":[{"title":"SingletonEHan02.java <span style='color:#111;'> 1.06KB </span>","children":null,"spread":false},{"title":"SingletonLanHan02.java <span style='color:#111;'> 1022B </span>","children":null,"spread":false},{"title":"SingletonEnum.java <span style='color:#111;'> 334B </span>","children":null,"spread":false},{"title":"SingletonPattern.java <span style='color:#111;'> 1.42KB </span>","children":null,"spread":false},{"title":"SingletonDoubleCheck.java <span style='color:#111;'> 1.04KB </span>","children":null,"spread":false},{"title":"SingletonEHan01.java <span style='color:#111;'> 1006B </span>","children":null,"spread":false},{"title":"SingletonInnerClass.java <span style='color:#111;'> 947B </span>","children":null,"spread":false},{"title":"SingletonLanHan03.java <span style='color:#111;'> 1.22KB </span>","children":null,"spread":false},{"title":"SingletonLanHan01.java <span style='color:#111;'> 925B </span>","children":null,"spread":false}],"spread":true},{"title":"AdapterPattern","children":[{"title":"ObjectAdapter","children":[{"title":"ObjectAdapterDemo.java <span style='color:#111;'> 507B </span>","children":null,"spread":false},{"title":"ObjectAdapter.java <span style='color:#111;'> 611B </span>","children":null,"spread":false}],"spread":true},{"title":"Adaptee.java <span style='color:#111;'> 302B </span>","children":null,"spread":false},{"title":"Target.java <span style='color:#111;'> 220B </span>","children":null,"spread":false},{"title":"ClassAdapter","children":[{"title":"ClassAdapter.java <span style='color:#111;'> 427B </span>","children":null,"spread":false},{"title":"ClassAdapterDemo.java <span style='color:#111;'> 386B </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"StatePattern","children":[{"title":"StatePatternDemo.java <span style='color:#111;'> 317B </span>","children":null,"spread":false},{"title":"State.java <span style='color:#111;'> 237B </span>","children":null,"spread":false},{"title":"Context.java <span style='color:#111;'> 509B </span>","children":null,"spread":false},{"title":"StateB.java <span style='color:#111;'> 308B </span>","children":null,"spread":false},{"title":"StateA.java <span style='color:#111;'> 308B </span>","children":null,"spread":false}],"spread":true},{"title":"TemplatePattern","children":[{"title":"TemplatePatternDemo.java <span style='color:#111;'> 601B </span>","children":null,"spread":false},{"title":"PureMilkTea.java <span style='color:#111;'> 360B </span>","children":null,"spread":false},{"title":"GrassJellyMilkTea.java <span style='color:#111;'> 333B </span>","children":null,"spread":false},{"title":"MilkTea.java <span style='color:#111;'> 974B </span>","children":null,"spread":false},{"title":"PearlMilkTea.java <span style='color:#111;'> 329B </span>","children":null,"spread":false}],"spread":true},{"title":"CommandPattern","children":[{"title":"ConcreteReciver2.java <span style='color:#111;'> 328B </span>","children":null,"spread":false},{"title":"CommandPatternDemo.java <span style='color:#111;'> 753B </span>","children":null,"spread":false},{"title":"ConcreteCommand1.java <span style='color:#111;'> 577B </span>","children":null,"spread":false},{"title":"ConcreteCommand2.java <span style='color:#111;'> 577B </span>","children":null,"spread":false},{"title":"Command.java <span style='color:#111;'> 270B </span>","children":null,"spread":false},{"title":"Receiver.java <span style='color:#111;'> 375B </span>","children":null,"spread":false},{"title":"ConcreteReciver1.java <span style='color:#111;'> 328B </span>","children":null,"spread":false},{"title":"Invoker.java <span style='color:#111;'> 706B </span>","children":null,"spread":false}],"spread":true},{"title":"DecoratorPattern","children":[{"title":"GrassJelly.java <span style='color:#111;'> 300B </span>","children":null,"spread":false},{"title":"Ingredients.java <span style='color:#111;'> 591B </span>","children":null,"spread":false},{"title":"Peanut.java <span style='color:#111;'> 494B </span>","children":null,"spread":false},{"title":"Milkytea.java <span style='color:#111;'> 252B </span>","children":null,"spread":false},{"title":"DecoratorPatternDemo.java <span style='color:#111;'> 575B </span>","children":null,"spread":false},{"title":"Pearl.java <span style='color:#111;'> 492B </span>","children":null,"spread":false}],"spread":true},{"title":"ObserverPattern","children":[{"title":"SinaObserver.java <span style='color:#111;'> 361B </span>","children":null,"spread":false},{"title":"Observer.java <span style='color:#111;'> 278B </span>","children":null,"spread":false},{"title":"WeatherSubject.java <span style='color:#111;'> 1.09KB </span>","children":null,"spread":false},{"title":"TVObserver.java <span style='color:#111;'> 359B </span>","children":null,"spread":false},{"title":"Subject.java <span style='color:#111;'> 501B </span>","children":null,"spread":false},{"title":"ObserverPatternDemo.java <span style='color:#111;'> 633B </span>","children":null,"spread":false}],"spread":true},{"title":"FacadePattern","children":[{"title":"SubSystem03.java <span style='color:#111;'> 239B </span>","children":null,"spread":false},{"title":"Facade.java <span style='color:#111;'> 553B </span>","children":null,"spread":false},{"title":"SubSystem02.java <span style='color:#111;'> 241B </span>","children":null,"spread":false},{"title":"FacadePattern.java <span style='color:#111;'> 348B </span>","children":null,"spread":false},{"title":"SubSystem01.java <span style='color:#111;'> 238B </span>","children":null,"spread":false}],"spread":true},{"title":"BuilderPattern","children":[{"title":"Manager.java <span style='color:#111;'> 808B </span>","children":null,"spread":false},{"title":"Engineer.java <span style='color:#111;'> 901B </span>","children":null,"spread":false},{"title":"SeniorEngineer.java <span style='color:#111;'> 492B </span>","children":null,"spread":false},{"title":"Computer.java <span style='color:#111;'> 780B </span>","children":null,"spread":false},{"title":"IntermediateEngineer.java <span style='color:#111;'> 495B </span>","children":null,"spread":false},{"title":"BuilderPatternDemo.java <span style='color:#111;'> 778B </span>","children":null,"spread":false}],"spread":true},{"title":"FactoryPattern","children":[{"title":"AbstractFactoryPattern","children":[{"title":"ProductBb.java <span style='color:#111;'> 286B </span>","children":null,"spread":false},{"title":"Product.java <span style='color:#111;'> 330B </span>","children":null,"spread":false},{"title":"ProductB.java <span style='color:#111;'> 213B </span>","children":null,"spread":false},{"title":"ProductAa.java <span style='color:#111;'> 289B </span>","children":null,"spread":false},{"title":"AbstractFactoryA.java <span style='color:#111;'> 485B </span>","children":null,"spread":false},{"title":"AbstractFactory.java <span style='color:#111;'> 587B </span>","children":null,"spread":false},{"title":"ProductA.java <span style='color:#111;'> 213B </span>","children":null,"spread":false},{"title":"AbstractFactoryDemo.java <span style='color:#111;'> 509B </span>","children":null,"spread":false}],"spread":true},{"title":"SimpleFactoryPattern","children":[{"title":"CocoProduct.java <span style='color:#111;'> 339B </span>","children":null,"spread":false},{"title":"SimpleFactory.java <span style='color:#111;'> 935B </span>","children":null,"spread":false},{"title":"Product.java <span style='color:#111;'> 377B </span>","children":null,"spread":false},{"title":"CofficeProduct.java <span style='color:#111;'> 342B </span>","children":null,"spread":false},{"title":"MilkProduct.java <span style='color:#111;'> 338B </span>","children":null,"spread":false},{"title":"SimpleFactoryDemo.java <span style='color:#111;'> 691B </span>","children":null,"spread":false}],"spread":false},{"title":"FactoryPattern","children":[{"title":"Product.java <span style='color:#111;'> 309B </span>","children":null,"spread":false},{"title":"FactoryA.java <span style='color:#111;'> 317B </span>","children":null,"spread":false},{"title":"ProductB.java <span style='color:#111;'> 278B </span>","children":null,"spread":false},{"title":"Factory.java <span style='color:#111;'> 365B </span>","children":null,"spread":false},{"title":"ProductA.java <span style='color:#111;'> 278B </span>","children":null,"spread":false},{"title":"FactoryB.java <span style='color:#111;'> 317B </span>","children":null,"spread":false},{"title":"FactoryDemo.java <span style='color:#111;'> 460B </span>","children":null,"spread":false}],"spread":false}],"spread":true}],"spread":false},{"title":"DesignPattern.iml <span style='color:#111;'> 437B </span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明