Giter VIP home page Giter VIP logo

java-design's Introduction

依托于具体场景,使用Java实现设计模式

创建型

  • 单例模式:singleton-demo,单例模式七种写法及并发测试

行为型

  • 观察者模式:小车摇号后需要推送消息到MQ及发送短信息到用户
  • 责任链模式:模拟日志打印器,根据传入参数的不通打印不通类型的日志
  • 命令模式:顾客点菜,小二记下菜,点完之后小二通知各种菜系的厨师做菜
  • 策略模式:商品折扣的不同策略:满减、直减、折扣和 N 元购

结构型

  • 代理模式:简单实现MyBatis,定义一个UserMapper接口,通过代理模式生成其代理类,执行具体方法
  • 装饰器模式:使用装饰器给不同的图形添加边框

参考:

  1. 结城浩.图解设计模式 [M] .人民邮电出版社,2017
  2. 程杰.大话设计模式 [M] .清华大学出版社,2007
  3. 菜鸟教程
  4. CS-Notes
  5. 重学设计模式

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.